after they've reacquired the interpreter lock.
Returns 1 on timeout, -1 on error, 0 otherwise. */
static int
-internal_select_ex(PySocketSockObject *s, int writing, _PyTime_t interval)
+internal_select(PySocketSockObject *s, int writing, _PyTime_t interval)
{
int n;
#ifdef HAVE_POLL
return 0;
}
-static int
-internal_select(PySocketSockObject *s, int writing)
-{
- return internal_select_ex(s, writing, s->sock_timeout);
-}
-
/*
Two macros for automatic retry of select() in case of false positives
(for example, select() could indicate a socket is ready for reading
BEGIN_SELECT_LOOP(s)
- timeout = internal_select_ex(s, 0, interval);
+ timeout = internal_select(s, 0, interval);
if (!timeout) {
Py_BEGIN_ALLOW_THREADS
BEGIN_SELECT_LOOP(s)
do {
- timeout = internal_select_ex(s, 0, interval);
+ timeout = internal_select(s, 0, interval);
if (!timeout) {
Py_BEGIN_ALLOW_THREADS
if (s->sock_timeout > 0
&& res < 0 && errno == EINPROGRESS && IS_SELECTABLE(s)) {
- timeout = internal_select(s, 1);
+ timeout = internal_select(s, 1, s->sock_timeout);
if (timeout == 0) {
/* Bug #1019808: in case of an EINPROGRESS,
BEGIN_SELECT_LOOP(s)
do {
- timeout = internal_select_ex(s, 0, interval);
+ timeout = internal_select(s, 0, interval);
if (!timeout) {
Py_BEGIN_ALLOW_THREADS
BEGIN_SELECT_LOOP(s)
do {
memset(&addrbuf, 0, addrlen);
- timeout = internal_select_ex(s, 0, interval);
+ timeout = internal_select(s, 0, interval);
if (!timeout) {
Py_BEGIN_ALLOW_THREADS
msg.msg_iovlen = iovlen;
msg.msg_control = controlbuf;
msg.msg_controllen = controllen;
- timeout = internal_select_ex(s, 0, interval);
+ timeout = internal_select(s, 0, interval);
if (timeout == 1) {
PyErr_SetString(socket_timeout, "timed out");
BEGIN_SELECT_LOOP(s)
do {
- timeout = internal_select_ex(s, 1, interval);
+ timeout = internal_select(s, 1, interval);
if (!timeout) {
Py_BEGIN_ALLOW_THREADS
}
do {
- timeout = internal_select(s, 1);
+ timeout = internal_select(s, 1, s->sock_timeout);
n = -1;
if (!timeout) {
BEGIN_SELECT_LOOP(s)
do {
- timeout = internal_select_ex(s, 1, interval);
+ timeout = internal_select(s, 1, interval);
if (!timeout) {
Py_BEGIN_ALLOW_THREADS
BEGIN_SELECT_LOOP(s)
do {
- timeout = internal_select_ex(s, 1, interval);
+ timeout = internal_select(s, 1, interval);
if (!timeout) {
Py_BEGIN_ALLOW_THREADS;