aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2009-03-03 11:01:24 +0000
committerDaniel Stenberg <daniel@haxx.se>2009-03-03 11:01:24 +0000
commitee73fc361ba33a2c6308bac1a75e3c0b8fe639eb (patch)
tree44ff25c18d7e3e5bcbf8b2e17dfda96f4e7cd73f /lib
parente84dbd28dbb28414356819131fc119f5cc12cc41 (diff)
- David James brought a patch that make libcurl close (all) dead connections
whenever you attempt to open a new connection.
Diffstat (limited to 'lib')
-rw-r--r--lib/url.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/url.c b/lib/url.c
index 6d2e6d4b7..22b8f7dfd 100644
--- a/lib/url.c
+++ b/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 */