mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
sws: timeout idle CONNECT connections
This commit is contained in:
parent
4aa9bb6b13
commit
becff7da56
@ -5,7 +5,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -1427,6 +1427,7 @@ static void http_connect(curl_socket_t *infdp,
|
|||||||
int max_tunnel_idx; /* CTRL or DATA */
|
int max_tunnel_idx; /* CTRL or DATA */
|
||||||
int loop;
|
int loop;
|
||||||
int i;
|
int i;
|
||||||
|
int timeout_count=0;
|
||||||
|
|
||||||
/* primary tunnel client endpoint already connected */
|
/* primary tunnel client endpoint already connected */
|
||||||
clientfd[CTRL] = *infdp;
|
clientfd[CTRL] = *infdp;
|
||||||
@ -1455,7 +1456,7 @@ static void http_connect(curl_socket_t *infdp,
|
|||||||
|
|
||||||
fd_set input;
|
fd_set input;
|
||||||
fd_set output;
|
fd_set output;
|
||||||
struct timeval timeout = {0, 250000L}; /* 250 ms */
|
struct timeval timeout = {1, 0}; /* 1000 ms */
|
||||||
ssize_t rc;
|
ssize_t rc;
|
||||||
curl_socket_t maxfd = (curl_socket_t)-1;
|
curl_socket_t maxfd = (curl_socket_t)-1;
|
||||||
|
|
||||||
@ -1516,6 +1517,7 @@ static void http_connect(curl_socket_t *infdp,
|
|||||||
if(rc > 0) {
|
if(rc > 0) {
|
||||||
/* socket action */
|
/* socket action */
|
||||||
bool tcp_fin_wr;
|
bool tcp_fin_wr;
|
||||||
|
timeout_count=0;
|
||||||
|
|
||||||
if(got_exit_signal)
|
if(got_exit_signal)
|
||||||
break;
|
break;
|
||||||
@ -1757,7 +1759,13 @@ static void http_connect(curl_socket_t *infdp,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
} /* (rc > 0) */
|
} /* (rc > 0) */
|
||||||
|
else {
|
||||||
|
timeout_count++;
|
||||||
|
if(timeout_count > 5) {
|
||||||
|
logmsg("CONNECT proxy timeout after %d idle seconds!", timeout_count);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
http_connect_cleanup:
|
http_connect_cleanup:
|
||||||
|
Loading…
Reference in New Issue
Block a user