diff options
author | Daniel Stenberg <daniel@haxx.se> | 2001-04-11 06:59:00 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2001-04-11 06:59:00 +0000 |
commit | 62056a644f712c47d56fa9ddcebda2539c4609a6 (patch) | |
tree | 1fc831eec76cab417db6baec37c0073003754679 | |
parent | b2362bf51c525b1b42874984c2d37c7fe577e644 (diff) | |
download | gnurl-62056a644f712c47d56fa9ddcebda2539c4609a6.tar.gz gnurl-62056a644f712c47d56fa9ddcebda2539c4609a6.tar.bz2 gnurl-62056a644f712c47d56fa9ddcebda2539c4609a6.zip |
oops, missed the shut-off non-blocking fix
-rw-r--r-- | lib/url.c | 22 |
1 files changed, 13 insertions, 9 deletions
@@ -1232,7 +1232,7 @@ static CURLcode ConnectPlease(struct UrlData *data, FD_ZERO (&connectfd); FD_SET(conn->firstsocket, &connectfd); if (conn->data->connecttimeout > 0) { - nonblock = 1; + nonblock = 1; } ioctlsocket(conn->firstsocket, FIONBIO, &nonblock); #endif @@ -1241,14 +1241,18 @@ static CURLcode ConnectPlease(struct UrlData *data, sizeof(conn->serv_addr) ) < 0) { #if defined(WIN32) - conntimeout.tv_sec = conn->data->connecttimeout; - conntimeout.tv_usec = 0; - if(-1 != select (conn->firstsocket + 1, NULL, &connectfd, NULL, &conntimeout)) { - if (FD_ISSET(conn->firstsocket, &connectfd)) - return CURLE_OK; - else - errno = EINTR; - } + conntimeout.tv_sec = conn->data->connecttimeout; + conntimeout.tv_usec = 0; + if(-1 != select (conn->firstsocket + 1, NULL, &connectfd, NULL, &conntimeout)) { + if (FD_ISSET(conn->firstsocket, &connectfd)) { + /* shut off non-blocking again */ + nonblock = 0; + ioctlsocket(conn->firstsocket, FIONBIO, &nonblock); + return CURLE_OK; + } + else + errno = EINTR; + } #endif switch(errno) { #ifdef ECONNREFUSED |