cpython: fa5542660b17 (original) (raw)

--- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -591,19 +591,13 @@ internal_setblocking(PySocketSockObject return 1; } -/* Do a select()/poll() on the socket, if necessary (sock_timeout > 0).

#ifdef HAVE_POLL struct pollfd pollfd;

#else fd_set fds; struct timeval tv; @@ -633,12 +627,11 @@ internal_select(PySocketSockObject s, i pollfd.events = writing ? POLLOUT : POLLIN; / s->sock_timeout is in seconds, timeout in ms */

Py_BEGIN_ALLOW_THREADS;

#else _PyTime_AsTimeval_noraise(interval, &tv, _PyTime_ROUND_CEILING); @@ -664,6 +657,23 @@ internal_select(PySocketSockObject s, i return 0; } +/ Do a select()/poll() on the socket, if necessary (sock_timeout > 0).

+} + +static int +internal_connect_select(PySocketSockObject *s) +{

+} + /* Two macros for automatic retry of select() in case of false positives (for example, select() could indicate a socket is ready for reading @@ -2492,7 +2502,7 @@ internal_connect(PySocketSockObject *s, if (s->sock_timeout > 0 && res < 0 && errno == EINPROGRESS && IS_SELECTABLE(s)) {

if (timeout == 0) { /* Bug #1019808: in case of an EINPROGRESS,