? ares/libcares.pc
Index: lib/multi.c
===================================================================
RCS file: /cvsroot/curl/curl/lib/multi.c,v
retrieving revision 1.161
diff -U 20 -r1.161 multi.c
--- lib/multi.c	21 Jan 2008 23:48:58 -0000	1.161
+++ lib/multi.c	22 Jan 2008 12:03:49 -0000
@@ -567,47 +567,50 @@
   if(!GOOD_MULTI_HANDLE(multi))
     return CURLM_BAD_HANDLE;
 
   /* Verify that we got a somewhat good easy handle too */
   if(!GOOD_EASY_HANDLE(curl_handle))
     return CURLM_BAD_EASY_HANDLE;
 
   /* pick-up from the 'curl_handle' the kept position in the list */
   easy = ((struct SessionHandle *)curl_handle)->multi_pos;
 
   if(easy) {
     bool premature = (bool)(easy->state != CURLM_STATE_COMPLETED);
 
     /* If the 'state' is not INIT or COMPLETED, we might need to do something
        nice to put the easy_handle in a good known state when this returns. */
     if(premature)
       /* this handle is "alive" so we need to count down the total number of
          alive connections when this is removed */
       multi->num_alive--;
 
-    if(easy->easy_handle->state.is_in_pipeline &&
+    if(easy->easy_conn &&
+        easy->easy_handle->state.is_in_pipeline &&
         easy->state > CURLM_STATE_WAITDO &&
-        easy->state < CURLM_STATE_COMPLETED)
+        easy->state < CURLM_STATE_COMPLETED) {
       /* If the handle is in a pipeline and has started sending off its
          request but not received its reponse yet, we need to close
          connection. */
       easy->easy_conn->bits.close = TRUE;
+      easy->easy_conn->data = easy->easy_handle;
+    }
 
     /* The timer must be shut down before easy->multi is set to NULL,
        else the timenode will remain in the splay tree after
        curl_easy_cleanup is called. */
     Curl_expire(easy->easy_handle, 0);
 
     if(easy->easy_handle->dns.hostcachetype == HCACHE_MULTI) {
       /* clear out the usage of the shared DNS cache */
       easy->easy_handle->dns.hostcache = NULL;
       easy->easy_handle->dns.hostcachetype = HCACHE_NONE;
     }
 
     /* we must call Curl_done() here (if we still "own it") so that we don't
        leave a half-baked one around */
     if(easy->easy_conn &&
        (easy->easy_conn->data == easy->easy_handle)) {
 
       /* Curl_done() clears the conn->data field to lose the association
          between the easy handle and the connection */
       Curl_done(&easy->easy_conn, easy->result, premature);
