2302a2303,2306 > #ifdef MS_WINDOWS > int retries = 0; > static const int MAX_RECV_RETRIES = 1; > #endif /* MS_WINDOWS */ 2313a2318,2320 > #ifdef MS_WINDOWS > while (TRUE) { > #endif /* MS_WINDOWS */ 2324a2332,2345 > #ifdef MS_WINDOWS > if ((WSAEWOULDBLOCK == WSAGetLastError()) && (s->sock_timeout > 0.0) && > (retries < MAX_RECV_RETRIES)) { > /* Windows sockets has a problem where select may indicate > that a socket is readable when in fact no data is > available and so recv results in WSAEWOULDBLOCK which > is supposed to be treated as a recoverable error. This > will typically happen immediately rather than after having > waited so it shouldn't be necessary to reduce the timeout > for the retry by the amount of time already waited. */ > ++retries; > continue; > } > #endif /* MS_WINDOWS */ 2329a2351,2355 > #ifdef MS_WINDOWS > else > break; > } /* while (TRUE) */ > #endif /* MS_WINDOWS */