Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
0f64bd26
Commit
0f64bd26
authored
Feb 22, 2012
by
Tatjana Azundris Nuernberg
Browse files
Options
Browse Files
Download
Plain Diff
auto-merge
parents
f3eb021d
a775a184
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
9 deletions
+50
-9
include/violite.h
include/violite.h
+3
-0
sql/mysqld.cc
sql/mysqld.cc
+8
-8
vio/viosocket.c
vio/viosocket.c
+39
-1
No files found.
include/violite.h
View file @
0f64bd26
...
...
@@ -61,6 +61,9 @@ int vio_close_pipe(Vio * vio);
#define HANDLE void *
#endif
/* __WIN__ */
/* backport from 5.6 where it is part of PSI, not vio_*() */
int
mysql_socket_shutdown
(
my_socket
mysql_socket
,
int
how
);
void
vio_delete
(
Vio
*
vio
);
int
vio_close
(
Vio
*
vio
);
void
vio_reset
(
Vio
*
vio
,
enum
enum_vio_type
type
,
...
...
sql/mysqld.cc
View file @
0f64bd26
...
...
@@ -932,7 +932,7 @@ static void close_connections(void)
{
if
(
ip_sock
!=
INVALID_SOCKET
)
{
(
void
)
shutdown
(
ip_sock
,
SHUT_RDWR
);
(
void
)
mysql_socket_
shutdown
(
ip_sock
,
SHUT_RDWR
);
(
void
)
closesocket
(
ip_sock
);
ip_sock
=
INVALID_SOCKET
;
}
...
...
@@ -964,7 +964,7 @@ static void close_connections(void)
#ifdef HAVE_SYS_UN_H
if
(
unix_sock
!=
INVALID_SOCKET
)
{
(
void
)
shutdown
(
unix_sock
,
SHUT_RDWR
);
(
void
)
mysql_socket_
shutdown
(
unix_sock
,
SHUT_RDWR
);
(
void
)
closesocket
(
unix_sock
);
(
void
)
unlink
(
mysqld_unix_port
);
unix_sock
=
INVALID_SOCKET
;
...
...
@@ -1069,7 +1069,7 @@ static void close_server_sock()
{
ip_sock
=
INVALID_SOCKET
;
DBUG_PRINT
(
"info"
,(
"calling shutdown on TCP/IP socket"
));
VOID
(
shutdown
(
tmp_sock
,
SHUT_RDWR
));
VOID
(
mysql_socket_
shutdown
(
tmp_sock
,
SHUT_RDWR
));
#if defined(__NETWARE__)
/*
The following code is disabled for normal systems as it causes MySQL
...
...
@@ -1084,7 +1084,7 @@ static void close_server_sock()
{
unix_sock
=
INVALID_SOCKET
;
DBUG_PRINT
(
"info"
,(
"calling shutdown on unix socket"
));
VOID
(
shutdown
(
tmp_sock
,
SHUT_RDWR
));
VOID
(
mysql_socket_
shutdown
(
tmp_sock
,
SHUT_RDWR
));
#if defined(__NETWARE__)
/*
The following code is disabled for normal systems as it may cause MySQL
...
...
@@ -5091,7 +5091,7 @@ pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused)))
if
(
req
.
sink
)
((
void
(
*
)(
int
))
req
.
sink
)(
req
.
fd
);
(
void
)
shutdown
(
new_sock
,
SHUT_RDWR
);
(
void
)
mysql_socket_
shutdown
(
new_sock
,
SHUT_RDWR
);
(
void
)
closesocket
(
new_sock
);
continue
;
}
...
...
@@ -5106,7 +5106,7 @@ pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused)))
if
(
getsockname
(
new_sock
,
&
dummy
,
&
dummyLen
)
<
0
)
{
sql_perror
(
"Error on new connection socket"
);
(
void
)
shutdown
(
new_sock
,
SHUT_RDWR
);
(
void
)
mysql_socket_
shutdown
(
new_sock
,
SHUT_RDWR
);
(
void
)
closesocket
(
new_sock
);
continue
;
}
...
...
@@ -5118,7 +5118,7 @@ pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused)))
if
(
!
(
thd
=
new
THD
))
{
(
void
)
shutdown
(
new_sock
,
SHUT_RDWR
);
(
void
)
mysql_socket_
shutdown
(
new_sock
,
SHUT_RDWR
);
VOID
(
closesocket
(
new_sock
));
continue
;
}
...
...
@@ -5137,7 +5137,7 @@ pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused)))
vio_delete
(
vio_tmp
);
else
{
(
void
)
shutdown
(
new_sock
,
SHUT_RDWR
);
(
void
)
mysql_socket_
shutdown
(
new_sock
,
SHUT_RDWR
);
(
void
)
closesocket
(
new_sock
);
}
delete
thd
;
...
...
vio/viosocket.c
View file @
0f64bd26
...
...
@@ -23,8 +23,15 @@
the file descriptior.
*/
#ifdef __WIN__
#include <winsock2.h>
#include <MSWSock.h>
#pragma comment(lib, "ws2_32.lib")
#endif
#include "vio_priv.h"
int
vio_errno
(
Vio
*
vio
__attribute__
((
unused
)))
{
return
socket_errno
;
/* On Win32 this mapped to WSAGetLastError() */
...
...
@@ -260,6 +267,37 @@ vio_was_interrupted(Vio *vio __attribute__((unused)))
}
int
mysql_socket_shutdown
(
my_socket
mysql_socket
,
int
how
)
{
int
result
;
#ifdef __WIN__
static
LPFN_DISCONNECTEX
DisconnectEx
=
NULL
;
if
(
DisconnectEx
==
NULL
)
{
DWORD
dwBytesReturned
;
GUID
guidDisconnectEx
=
WSAID_DISCONNECTEX
;
WSAIoctl
(
mysql_socket
,
SIO_GET_EXTENSION_FUNCTION_POINTER
,
&
guidDisconnectEx
,
sizeof
(
GUID
),
&
DisconnectEx
,
sizeof
(
DisconnectEx
),
&
dwBytesReturned
,
NULL
,
NULL
);
}
#endif
/* Non instrumented code */
#ifdef __WIN__
if
(
DisconnectEx
)
result
=
(
DisconnectEx
(
mysql_socket
,
(
LPOVERLAPPED
)
NULL
,
(
DWORD
)
0
,
(
DWORD
)
0
)
==
TRUE
)
?
0
:
-
1
;
else
#endif
result
=
shutdown
(
mysql_socket
,
how
);
return
result
;
}
int
vio_close
(
Vio
*
vio
)
{
int
r
=
0
;
...
...
@@ -272,7 +310,7 @@ int vio_close(Vio * vio)
vio
->
type
==
VIO_TYPE_SSL
);
DBUG_ASSERT
(
vio
->
sd
>=
0
);
if
(
shutdown
(
vio
->
sd
,
SHUT_RDWR
))
if
(
mysql_socket_
shutdown
(
vio
->
sd
,
SHUT_RDWR
))
r
=
-
1
;
if
(
closesocket
(
vio
->
sd
))
r
=
-
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment