aboutsummaryrefslogtreecommitdiff
path: root/lib/socks.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-02-07 22:25:04 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-02-07 22:25:04 +0000
commit1b701c746f66b8fd5bf3017c36254dbde8456df2 (patch)
tree9ce8d20c20100c4fb9bbec0966928641f9f910b7 /lib/socks.c
parent15bf16852705a585b694cb0d50d21f7edd6b7a88 (diff)
- Refactored a lot of timeout code into a few functions in an attempt to make
them all use the same (hopefully correct) logic to make it less error-prone and easier to introduce library-wide where it should be used.
Diffstat (limited to 'lib/socks.c')
-rw-r--r--lib/socks.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/lib/socks.c b/lib/socks.c
index dc159ad38..b78a04a45 100644
--- a/lib/socks.c
+++ b/lib/socks.c
@@ -138,18 +138,7 @@ CURLcode Curl_SOCKS4(const char *proxy_name,
struct SessionHandle *data = conn->data;
/* get timeout */
- if(data->set.timeout && data->set.connecttimeout) {
- if(data->set.timeout < data->set.connecttimeout)
- timeout = data->set.timeout;
- else
- timeout = data->set.connecttimeout;
- }
- else if(data->set.timeout)
- timeout = data->set.timeout;
- else if(data->set.connecttimeout)
- timeout = data->set.connecttimeout;
- else
- timeout = DEFAULT_CONNECT_TIMEOUT;
+ timeout = Curl_timeleft(conn, NULL, TRUE);
Curl_nonblock(sock, FALSE);
@@ -403,18 +392,7 @@ CURLcode Curl_SOCKS5(const char *proxy_name,
}
/* get timeout */
- if(data->set.timeout && data->set.connecttimeout) {
- if(data->set.timeout < data->set.connecttimeout)
- timeout = data->set.timeout;
- else
- timeout = data->set.connecttimeout;
- }
- else if(data->set.timeout)
- timeout = data->set.timeout;
- else if(data->set.connecttimeout)
- timeout = data->set.connecttimeout;
- else
- timeout = DEFAULT_CONNECT_TIMEOUT;
+ timeout = Curl_timeleft(conn, NULL, TRUE);
Curl_nonblock(sock, TRUE);