1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-11 12:05:06 -05:00

sws.c: improve proxy mode torture testing support - followup to c731fc58

This commit is contained in:
Yang Tse 2012-01-16 12:30:03 +01:00
parent c731fc58ea
commit 18c6c8a5e7

View File

@ -1310,23 +1310,17 @@ static void http_connect(curl_socket_t *infdp,
bool primary = FALSE; bool primary = FALSE;
bool secondary = FALSE; bool secondary = FALSE;
int max_tunnel_idx; /* CTRL or DATA */ int max_tunnel_idx; /* CTRL or DATA */
#if 0 int loop;
int quarters;
#endif
int i; int i;
/* primary tunnel client endpoint already connected */ /* primary tunnel client endpoint already connected */
clientfd[CTRL] = *infdp; clientfd[CTRL] = *infdp;
#if 0 /* Sleep here to make sure the client reads CONNECT response's
/* sleep here to make sure the client gets the CONNECT response 'end of headers' separate from the server data that follows.
first and separate from the data that might follow here */ This is done to prevent triggering libcurl known bug #39. */
quarters = 4; for(loop = 2; loop && !got_exit_signal; loop--)
while((quarters > 0) && !got_exit_signal) {
quarters--;
wait_ms(250); wait_ms(250);
}
#endif
if(got_exit_signal) if(got_exit_signal)
goto http_connect_cleanup; goto http_connect_cleanup;
@ -1548,7 +1542,6 @@ static void http_connect(curl_socket_t *infdp,
/* endpoint read/write disabling, endpoint closing and tunnel teardown */ /* endpoint read/write disabling, endpoint closing and tunnel teardown */
for(i = 0; i <= max_tunnel_idx; i++) { for(i = 0; i <= max_tunnel_idx; i++) {
int loop;
for(loop = 2; loop; loop--) { for(loop = 2; loop; loop--) {
/* loop twice to satisfy condition interdependencies without /* loop twice to satisfy condition interdependencies without
having to await select timeout or another socket event */ having to await select timeout or another socket event */
@ -1587,7 +1580,6 @@ static void http_connect(curl_socket_t *infdp,
/* socket clearing */ /* socket clearing */
for(i = 0; i <= max_tunnel_idx; i++) { for(i = 0; i <= max_tunnel_idx; i++) {
int loop;
for(loop = 2; loop; loop--) { for(loop = 2; loop; loop--) {
if(clientfd[i] != CURL_SOCKET_BAD) { if(clientfd[i] != CURL_SOCKET_BAD) {
if(!poll_client_wr[i] && !poll_client_rd[i]) { if(!poll_client_wr[i] && !poll_client_rd[i]) {