diff options
author | Yang Tse <yangsita@gmail.com> | 2012-01-17 12:28:28 +0100 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2012-01-17 12:28:28 +0100 |
commit | 2b9fafd6226448458995fc6c60c3de3552722c2a (patch) | |
tree | 45a8203df11e8dde409be882a0c4812aa08c22c6 | |
parent | 0ce2bca741ae596a346b2ab767dfbf5be9bc7dae (diff) |
sws.c: fix proxy mode secondary connection monitoring condition
-rw-r--r-- | tests/server/sws.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/server/sws.c b/tests/server/sws.c index 244f91b75..dddc606db 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -1349,9 +1349,12 @@ static void http_connect(curl_socket_t *infdp, FD_ZERO(&output); if((clientfd[DATA] == CURL_SOCKET_BAD) && - (serverfd[DATA] == CURL_SOCKET_BAD)) { - /* when secondary tunnel is not established the listener socket - is monitored to allow client to establish the secondary tunnel */ + (serverfd[DATA] == CURL_SOCKET_BAD) && + poll_client_rd[CTRL] && poll_client_wr[CTRL] && + poll_server_rd[CTRL] && poll_server_wr[CTRL]) { + /* listener socket is monitored to allow client to establish + secondary tunnel only when this tunnel is not established + and primary one is fully operational */ FD_SET(rootfd, &input); maxfd = rootfd; } @@ -1837,7 +1840,7 @@ int main(int argc, char *argv[]) use_gopher?"GOPHER":"HTTP", ipv_inuse, (int)port); /* start accepting connections */ - rc = listen(sock, 2); + rc = listen(sock, 5); if(0 != rc) { error = SOCKERRNO; logmsg("listen() failed with error: (%d) %s", |