mirror of
https://github.com/curl/curl.git
synced 2024-11-21 01:16:58 +08:00
- 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:
parent
e84dbd28db
commit
ee73fc361b
11
CHANGES
11
CHANGES
@ -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)
|
||||
|
@ -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)
|
||||
|
32
lib/url.c
32
lib/url.c
@ -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 */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user