mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
made the intended one hour default timeout in the CONNECT loop actually work
This commit is contained in:
parent
8726a6b6ed
commit
6ac9e67bd7
21
lib/http.c
21
lib/http.c
@ -1024,14 +1024,13 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,
|
|||||||
struct Curl_transfer_keeper *k = &conn->keep;
|
struct Curl_transfer_keeper *k = &conn->keep;
|
||||||
CURLcode result;
|
CURLcode result;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
size_t nread; /* total size read */
|
size_t nread; /* total size read */
|
||||||
int perline; /* count bytes per line */
|
int perline; /* count bytes per line */
|
||||||
bool keepon=TRUE;
|
bool keepon=TRUE;
|
||||||
ssize_t gotbytes;
|
ssize_t gotbytes;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
long timeout = 3600; /* default timeout in seconds */
|
long timeout =
|
||||||
|
data->set.timeout?data->set.timeout:3600; /* in seconds */
|
||||||
char *line_start;
|
char *line_start;
|
||||||
char *host_port;
|
char *host_port;
|
||||||
curl_socket_t tunnelsocket = conn->sock[sockindex];
|
curl_socket_t tunnelsocket = conn->sock[sockindex];
|
||||||
@ -1088,15 +1087,13 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,
|
|||||||
|
|
||||||
while((nread<BUFSIZE) && (keepon && !error)) {
|
while((nread<BUFSIZE) && (keepon && !error)) {
|
||||||
|
|
||||||
if(data->set.timeout) {
|
/* if timeout is requested, find out how much remaining time we have */
|
||||||
/* if timeout is requested, find out how much remaining time we have */
|
long check = timeout - /* timeout time */
|
||||||
timeout = data->set.timeout - /* timeout time */
|
Curl_tvdiff(Curl_tvnow(), conn->now)/1000; /* spent time */
|
||||||
Curl_tvdiff(Curl_tvnow(), conn->now)/1000; /* spent time */
|
if(check <=0 ) {
|
||||||
if(timeout <=0 ) {
|
failf(data, "Proxy CONNECT aborted due to timeout");
|
||||||
failf(data, "Proxy connection aborted due to timeout");
|
error = SELECT_TIMEOUT; /* already too little time */
|
||||||
error = SELECT_TIMEOUT; /* already too little time */
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* timeout each second and check the timeout */
|
/* timeout each second and check the timeout */
|
||||||
|
Loading…
Reference in New Issue
Block a user