From c4f1a9f690449482ee4333e1ec58169d5e5a3d25 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 31 Oct 2001 15:14:52 +0000 Subject: Removed the SocketIsDead() stuff for SSL again as it doesn't work. We must rely on the new go-ahead-and-try mechanism that I just added to Transfer() --- lib/url.c | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/lib/url.c b/lib/url.c index b11d33aac..0d0cf6ab5 100644 --- a/lib/url.c +++ b/lib/url.c @@ -877,7 +877,7 @@ CURLcode Curl_disconnect(struct connectdata *conn) if(-1 != conn->connectindex) { /* unlink ourselves! */ - infof(conn->data, "Closing live connection (#%d)\n", conn->connectindex); + infof(conn->data, "Closing connection #%d\n", conn->connectindex); conn->data->state.connects[conn->connectindex] = NULL; } @@ -935,7 +935,7 @@ CURLcode Curl_disconnect(struct connectdata *conn) * be dead. Most commonly this happens when the server has closed the * connection due to inactivity. */ -static bool SocketIsDead(struct connectdata *conn, int sock) +static bool SocketIsDead(int sock) { int sval; bool ret_val = TRUE; @@ -949,36 +949,9 @@ static bool SocketIsDead(struct connectdata *conn, int sock) to.tv_usec = 1; sval = select(sock + 1, &check_set, 0, 0, &to); - if(sval == 0) { + if(sval == 0) /* timeout */ ret_val = FALSE; -#ifdef USE_SSLEAY - /* the socket seems fine, but is the SSL later fine too? */ - if(conn->ssl.use) { - int peek; - int error; - Curl_nonblock(sock, TRUE); - - peek = SSL_peek(conn->ssl.handle, - conn->data->state.buffer, BUFSIZE); - - infof(conn->data, "SSL_peek returned %d\n", peek); - - if(-1 == peek) { - error = SSL_get_error(conn->ssl.handle, peek); - infof(conn->data, "SSL_error returned %d\n", error); - - if(SSL_ERROR_WANT_READ != error) - ret_val = TRUE; - } - else - /* peek did not return -1 */ - ret_val = TRUE; - - Curl_nonblock(sock, FALSE); - } -#endif - } return ret_val; } @@ -1021,7 +994,7 @@ ConnectionExists(struct SessionHandle *data, continue; } } - dead = SocketIsDead(check, check->firstsocket); + dead = SocketIsDead(check->firstsocket); if(dead) { infof(data, "Connection %d seems to be dead!\n", i); Curl_disconnect(check); /* disconnect resources */ @@ -2167,7 +2140,7 @@ CURLcode Curl_done(struct connectdata *conn) ((CURLE_OK == result) && conn->bits.close)) result = Curl_disconnect(conn); /* close the connection */ else - infof(data, "Connection (#%d) left alive\n", conn->connectindex); + infof(data, "Connection #%d left intact\n", conn->connectindex); return result; } -- cgit v1.2.3