diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-04-21 08:49:14 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-04-21 08:49:14 +0000 |
commit | 1401d909e8c95b75243712fb8aa14aa9ba2ecfef (patch) | |
tree | d5271cbe4aa70309e2c3395b25ab03e579682cbc /lib/transfer.c | |
parent | 323332262203448cbe6558983e51c0ae25cd1602 (diff) |
Fix the "lingering close" problem when re-using a connection, as test case
160 shows.
We got no data and we attempted to re-use a connection. This might happen if
the connection was left alive when we were done using it before, but that was
closed when we wanted to read from it again. Bad luck. Retry the same request
on a fresh connect!
Deleted the sockerror variable again, it serves no purpose anymore.
Diffstat (limited to 'lib/transfer.c')
-rw-r--r-- | lib/transfer.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/transfer.c b/lib/transfer.c index cb24dd30f..2d0b4aa33 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -1946,15 +1946,14 @@ CURLcode Curl_perform(struct SessionHandle *data) res = Transfer(conn); /* now fetch that URL please */ if(res == CURLE_OK) { - if((conn->keep.bytecount == 0) && - (conn->sockerror == ECONNRESET) && + if((conn->keep.bytecount+conn->headerbytecount == 0) && conn->bits.reuse) { - /* We got no data, the connection was reset and we did attempt - to re-use a connection. This smells like we were too fast to - re-use a connection that was closed when we wanted to read - from it. Bad luck. Let's simulate a redirect to the same URL - to retry! */ - infof(data, "Connection reset, retrying a fresh connect\n"); + /* We got no data and we attempted to re-use a connection. This + might happen if the connection was left alive when we were done + using it before, but that was closed when we wanted to read + from it again. Bad luck. Retry the same request on a fresh + connect! */ + infof(data, "Connection died, retrying a fresh connect\n"); newurl = strdup(conn->data->change.url); conn->bits.close = TRUE; /* close this connection */ |