Commit 5814187f authored by Tim Peters's avatar Tim Peters

internal_connect(): Windows. When sock_timeout > 0 and connect() yields

WSAEWOULDBLOCK, the second connect() attempt appears to yield WSAEISCONN
on Win98 but WSAEINVAL on Win2K.  So accept either as meaning "yawn,
fine".  This allows test_socket to succeed on my Win2K box (which it
already did on my Win98SE box).
parent d37f75b8
......@@ -1305,10 +1305,18 @@ internal_connect(PySocketSockObject *s, struct sockaddr *addr, int addrlen)
if (res < 0 && WSAGetLastError() == WSAEWOULDBLOCK) {
internal_select(s, 1);
res = connect(s->sock_fd, addr, addrlen);
if (res < 0 && WSAGetLastError() == WSAEISCONN)
if (res < 0) {
/* On Win98, WSAEISCONN was seen here. But
* on Win2K, WSAEINVAL. So accept both as
* meaning "fine".
*/
int code = WSAGetLastError();
if (code == WSAEISCONN ||
code == WSAEINVAL)
res = 0;
}
}
}
if (res < 0)
res = WSAGetLastError();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment