New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
socketmodule.c connection handling incorect on windows #38930
Comments
The socketmodule.c code does not handle connection #ifdef MS_WINDOWS
f (s->sock_timeout > 0.0) {
if (res < 0 && WSAGetLastError() == WSAEWOULDBLOCK) {
/* This is a mess. Best solution: trust select */
fd_set exfds;
struct timeval tv;
tv.tv_sec = (int)s->sock_timeout;
tv.tv_usec = (int)((s->sock_timeout - tv.tv_sec) * 1e6);
FD_ZERO(&exfds);
FD_SET(s->sock_fd, &exfds);
/* Platform SDK says so */
res = select(s->sock_fd+1, NULL, NULL, &exfds, &tv);
if (res > 0) {
if( FD_ISSET( &exfds ) ) {
/* Get the real reason */
getsockopt(s->sock_fd,SOL_SOCKET,SO_ERROR,(char*)&res,sizeof(res));
} else {
/* God knows how we got here */
res = 0;
}
} else if( res == 0 ) {
res = WSAEWOULDBLOCK;
} else
{
/* Not sure we should return the erro from select? */
res = WSAGetLastError();
}
}
} else if (res < 0)
res = WSAGetLastError(); #else |
Logged In: YES Garth could you produce a patch against 2.3c2 with your |
Logged In: YES I have turned Garth's code into a patch versus Python 2.3.4. |
Logged In: YES http://python.org/sf/965036 has been updated with a fixed |
Logged In: YES Unassigned myself (no particular competence here, and short |
Fixed in r36739 according to bpo-965036. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: