mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-23 00:59:51 +08:00
* fhandler_socket.cc (fhandler_socket::evaluate_events): Call
WSASetLastError after setsockopt. Explain why.
This commit is contained in:
parent
a4893fb8b7
commit
5d427504a3
@ -1,3 +1,8 @@
|
|||||||
|
2014-06-16 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler_socket.cc (fhandler_socket::evaluate_events): Call
|
||||||
|
WSASetLastError after setsockopt. Explain why.
|
||||||
|
|
||||||
2014-05-22 Corinna Vinschen <corinna@vinschen.de>
|
2014-05-22 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* gmon.h: Pull in profile.h. Explain why.
|
* gmon.h: Pull in profile.h. Explain why.
|
||||||
|
@ -633,7 +633,6 @@ fhandler_socket::evaluate_events (const long event_mask, long &events,
|
|||||||
int wsa_err = 0;
|
int wsa_err = 0;
|
||||||
if ((wsa_err = wsock_events->connect_errorcode) != 0)
|
if ((wsa_err = wsock_events->connect_errorcode) != 0)
|
||||||
{
|
{
|
||||||
WSASetLastError (wsa_err);
|
|
||||||
/* CV 2014-04-23: This is really weird. If you call connect
|
/* CV 2014-04-23: This is really weird. If you call connect
|
||||||
asynchronously on a socket and then select, an error like
|
asynchronously on a socket and then select, an error like
|
||||||
"Connection refused" is set in the event and in the SO_ERROR
|
"Connection refused" is set in the event and in the SO_ERROR
|
||||||
@ -642,9 +641,14 @@ fhandler_socket::evaluate_events (const long event_mask, long &events,
|
|||||||
option, even if the dup'ed socket handle refers to the same
|
option, even if the dup'ed socket handle refers to the same
|
||||||
socket. We're trying to workaround this problem here by
|
socket. We're trying to workaround this problem here by
|
||||||
taking the connect errorcode from the event and write it back
|
taking the connect errorcode from the event and write it back
|
||||||
into the SO_ERROR socket option. */
|
into the SO_ERROR socket option.
|
||||||
|
|
||||||
|
CV 2014-06-16: Call WSASetLastError *after* setsockopt since,
|
||||||
|
apparently, setsockopt sets the last WSA error code to 0 on
|
||||||
|
success. */
|
||||||
setsockopt (get_socket (), SOL_SOCKET, SO_ERROR,
|
setsockopt (get_socket (), SOL_SOCKET, SO_ERROR,
|
||||||
(const char *) &wsa_err, sizeof wsa_err);
|
(const char *) &wsa_err, sizeof wsa_err);
|
||||||
|
WSASetLastError (wsa_err);
|
||||||
ret = SOCKET_ERROR;
|
ret = SOCKET_ERROR;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user