- David James brought a patch that make libcurl close (all) dead connections

whenever you attempt to open a new connection.
This commit is contained in:
Daniel Stenberg 2009-03-03 11:01:24 +00:00
parent e84dbd28db
commit ee73fc361b
3 changed files with 30 additions and 18 deletions

11
CHANGES
View File

@ -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)

View File

@ -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)

View File

@ -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 */