? ares/libcares.pc
Index: lib/multi.c
===================================================================
RCS file: /cvsroot/curl/curl/lib/multi.c,v
retrieving revision 1.162
diff -U 20 -r1.162 multi.c
--- lib/multi.c	23 Jan 2008 12:22:04 -0000	1.162
+++ lib/multi.c	27 Jan 2008 04:31:59 -0000
@@ -854,40 +854,41 @@
   bool dophase_done;
   bool done;
   CURLMcode result = CURLM_OK;
   struct SingleRequest *k;
 
   do {
     bool disconnect_conn = FALSE;
 
     if(!GOOD_EASY_HANDLE(easy->easy_handle))
       return CURLM_BAD_EASY_HANDLE;
 
     /* Handle the case when the pipe breaks, i.e., the connection
        we're using gets cleaned up and we're left with nothing. */
     if(easy->easy_handle->state.pipe_broke) {
       infof(easy->easy_handle, "Pipe broke: handle 0x%x, url = %s\n",
             easy, easy->easy_handle->state.path);
 
       if(easy->easy_handle->state.is_in_pipeline) {
         /* Head back to the CONNECT state */
         multistate(easy, CURLM_STATE_CONNECT);
+        easy->easy_handle->state.is_in_pipeline = FALSE;
         result = CURLM_CALL_MULTI_PERFORM;
         easy->result = CURLE_OK;
       }
       else {
         easy->result = CURLE_COULDNT_CONNECT;
         multistate(easy, CURLM_STATE_COMPLETED);
       }
 
       easy->easy_handle->state.pipe_broke = FALSE;
       easy->easy_conn = NULL;
       break;
     }
 
     if(easy->state > CURLM_STATE_CONNECT &&
         easy->state < CURLM_STATE_COMPLETED) {
       /* Make sure we set the connection's current owner */
       easy->easy_conn->data = easy->easy_handle;
     }
 
     if(CURLM_STATE_WAITCONNECT <= easy->state &&
@@ -1269,63 +1270,65 @@
 
       k = &easy->easy_handle->req;
 
       if(!(k->keepon & KEEP_READ)) {
         /* We're done reading */
         easy->easy_conn->readchannel_inuse = FALSE;
       }
 
       if(!(k->keepon & KEEP_WRITE)) {
         /* We're done writing */
         easy->easy_conn->writechannel_inuse = FALSE;
       }
 
       if(easy->result)  {
         /* The transfer phase returned error, we mark the connection to get
          * closed to prevent being re-used. This is because we can't
          * possibly know if the connection is in a good shape or not now. */
         easy->easy_conn->bits.close = TRUE;
         Curl_removeHandleFromPipeline(easy->easy_handle,
                                       easy->easy_conn->recv_pipe);
+        easy->easy_handle->state.is_in_pipeline = FALSE;
 
         if(CURL_SOCKET_BAD != easy->easy_conn->sock[SECONDARYSOCKET]) {
           /* if we failed anywhere, we must clean up the secondary socket if
              it was used */
           sclose(easy->easy_conn->sock[SECONDARYSOCKET]);
           easy->easy_conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD;
         }
         Curl_posttransfer(easy->easy_handle);
         Curl_done(&easy->easy_conn, easy->result, FALSE);
       }
       else if(TRUE == done) {
         char *newurl;
         bool retry = Curl_retry_request(easy->easy_conn, &newurl);
 
         /* call this even if the readwrite function returned error */
         Curl_posttransfer(easy->easy_handle);
 
         /* When we follow redirects, must to go back to the CONNECT state */
         if(easy->easy_handle->req.newurl || retry) {
           Curl_removeHandleFromPipeline(easy->easy_handle,
                                         easy->easy_conn->recv_pipe);
           /* Check if we can move pending requests to send pipe */
           checkPendPipeline(easy->easy_conn);
+          easy->easy_handle->state.is_in_pipeline = FALSE;
           if(!retry) {
             /* if the URL is a follow-location and not just a retried request
                then figure out the URL here */
             newurl = easy->easy_handle->req.newurl;
             easy->easy_handle->req.newurl = NULL;
           }
           easy->result = Curl_done(&easy->easy_conn, CURLE_OK, FALSE);
           if(easy->result == CURLE_OK)
             easy->result = Curl_follow(easy->easy_handle, newurl, retry);
           if(CURLE_OK == easy->result) {
             multistate(easy, CURLM_STATE_CONNECT);
             result = CURLM_CALL_MULTI_PERFORM;
           }
           else
             /* Since we "took it", we are in charge of freeing this on
                failure */
             free(newurl);
         }
         else {
           /* after the transfer is done, go DONE */
