diff options
author | Daniel Stenberg <daniel@haxx.se> | 2009-03-03 11:01:24 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2009-03-03 11:01:24 +0000 |
commit | ee73fc361ba33a2c6308bac1a75e3c0b8fe639eb (patch) | |
tree | 44ff25c18d7e3e5bcbf8b2e17dfda96f4e7cd73f | |
parent | e84dbd28dbb28414356819131fc119f5cc12cc41 (diff) |
- David James brought a patch that make libcurl close (all) dead connections
whenever you attempt to open a new connection.
-rw-r--r-- | CHANGES | 11 | ||||
-rw-r--r-- | RELEASE-NOTES | 5 | ||||
-rw-r--r-- | lib/url.c | 32 |
3 files changed, 30 insertions, 18 deletions
@@ -6,6 +6,17 @@ Changelog +Daniel Stenberg (3 Mar 2009) +- David James brought a patch that make libcurl close (all) dead connections + whenever you attempt to open a new connection. + + 1. After cleaning up a dead connection, "continue" instead of + returning FALSE. This ensures that we clean up all dead connections, + rather than just cleaning up the first dead connection. + 2. Move up the cleanup for dead connections so that it occurs for + all connections, rather than just the connections which have the same + preferences as our current new connection. + Version 7.19.4 (3 March 2009) Daniel Stenberg (3 Mar 2009) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index badec7854..2dc9daf81 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -9,7 +9,8 @@ Curl and libcurl 7.19.5 This release includes the following changes: - o + o libcurl now closes all dead connections whenever you attempt to open a new + connection This release includes the following bugfixes: @@ -22,6 +23,6 @@ This release includes the following known bugs: This release would not have looked like this without help, code, reports and advice from friends like these: - + David James Thanks! (and sorry if I forgot to mention someone) @@ -2565,6 +2565,22 @@ ConnectionExists(struct SessionHandle *data, from the multi */ } + if(!pipeLen && !check->inuse) { + /* The check for a dead socket makes sense only if there are no + handles in pipeline and the connection isn't already marked in + use */ + bool dead = SocketIsDead(check->sock[FIRSTSOCKET]); + if(dead) { + check->data = data; + infof(data, "Connection #%d seems to be dead!\n", i); + + Curl_disconnect(check); /* disconnect resources */ + data->state.connc->connects[i]=NULL; /* nothing here */ + + continue; + } + } + if(canPipeline) { /* Make sure the pipe has only GET requests */ struct SessionHandle* sh = gethandleathead(check->send_pipe); @@ -2688,22 +2704,6 @@ ConnectionExists(struct SessionHandle *data, } if(match) { - if(!pipeLen && !check->inuse) { - /* The check for a dead socket makes sense only if there are no - handles in pipeline and the connection isn't already marked in - use */ - bool dead = SocketIsDead(check->sock[FIRSTSOCKET]); - if(dead) { - check->data = data; - infof(data, "Connection #%d seems to be dead!\n", i); - - Curl_disconnect(check); /* disconnect resources */ - data->state.connc->connects[i]=NULL; /* nothing here */ - - return FALSE; - } - } - check->inuse = TRUE; /* mark this as being in use so that no other handle in a multi stack may nick it */ |