diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-12-02 23:30:13 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-12-02 23:30:13 +0000 |
commit | 6ac9e67bd758e99a5ec385dba4492de3c35cd25f (patch) | |
tree | 0246234e155c2be21e85b9db419df2bf42b0e15e | |
parent | 8726a6b6ed8c063e51cd605347b9dc4baff886b7 (diff) |
made the intended one hour default timeout in the CONNECT loop actually work
-rw-r--r-- | lib/http.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/lib/http.c b/lib/http.c index 0a20c833c..d7a43ab30 100644 --- a/lib/http.c +++ b/lib/http.c @@ -1024,14 +1024,13 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn, struct Curl_transfer_keeper *k = &conn->keep; CURLcode result; int res; - size_t nread; /* total size read */ int perline; /* count bytes per line */ bool keepon=TRUE; ssize_t gotbytes; char *ptr; - long timeout = 3600; /* default timeout in seconds */ - + long timeout = + data->set.timeout?data->set.timeout:3600; /* in seconds */ char *line_start; char *host_port; curl_socket_t tunnelsocket = conn->sock[sockindex]; @@ -1088,15 +1087,13 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn, while((nread<BUFSIZE) && (keepon && !error)) { - if(data->set.timeout) { - /* if timeout is requested, find out how much remaining time we have */ - timeout = data->set.timeout - /* timeout time */ - Curl_tvdiff(Curl_tvnow(), conn->now)/1000; /* spent time */ - if(timeout <=0 ) { - failf(data, "Proxy connection aborted due to timeout"); - error = SELECT_TIMEOUT; /* already too little time */ - break; - } + /* if timeout is requested, find out how much remaining time we have */ + long check = timeout - /* timeout time */ + Curl_tvdiff(Curl_tvnow(), conn->now)/1000; /* spent time */ + if(check <=0 ) { + failf(data, "Proxy CONNECT aborted due to timeout"); + error = SELECT_TIMEOUT; /* already too little time */ + break; } /* timeout each second and check the timeout */ |