diff options
author | Daniel Stenberg <daniel@haxx.se> | 2008-02-11 22:03:31 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2008-02-11 22:03:31 +0000 |
commit | fcc320ee404606b7f9d4d140e7770a0f8dd2754d (patch) | |
tree | 6de4df1001ba130d74af3790c30bf0f34feabde7 /lib/socks.c | |
parent | dc9fe9c3610fe96554978d4b2f6090ac7887ef79 (diff) |
Yang Tse pointed out a few remaining quirks from my timeout refactoring from
Feb 7 that didn't abort properly on timeouts. These are actually old
problems but now they should be fixed.
Diffstat (limited to 'lib/socks.c')
-rw-r--r-- | lib/socks.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/socks.c b/lib/socks.c index b78a04a45..06a513e80 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -140,6 +140,12 @@ CURLcode Curl_SOCKS4(const char *proxy_name, /* get timeout */ timeout = Curl_timeleft(conn, NULL, TRUE); + if(timeout < 0) { + /* time-out, bail out, go home */ + failf(data, "Connection time-out"); + return CURLE_OPERATION_TIMEDOUT; + } + Curl_nonblock(sock, FALSE); /* @@ -394,6 +400,12 @@ CURLcode Curl_SOCKS5(const char *proxy_name, /* get timeout */ timeout = Curl_timeleft(conn, NULL, TRUE); + if(timeout < 0) { + /* time-out, bail out, go home */ + failf(data, "Connection time-out"); + return CURLE_OPERATION_TIMEDOUT; + } + Curl_nonblock(sock, TRUE); /* wait until socket gets connected */ |