Index: url.c =================================================================== RCS file: /cvsroot/curl/curl/lib/url.c,v retrieving revision 1.789 diff -u -r1.789 url.c --- url.c 28 Feb 2009 01:11:57 -0000 1.789 +++ url.c 2 Mar 2009 21:48:50 -0000 @@ -2543,6 +2543,22 @@ 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); @@ -2666,22 +2682,6 @@ } 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 */