aboutsummaryrefslogtreecommitdiff
path: root/lib/socks.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/socks.c')
-rw-r--r--lib/socks.c12
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 */