diff options
author | Daniel Stenberg <daniel@haxx.se> | 2008-01-23 12:22:04 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2008-01-23 12:22:04 +0000 |
commit | 79cb74f03a4fa5512812cc8c8e35d735a099b35c (patch) | |
tree | 445e09549ae006e4cce322d45556bc58c13b18de | |
parent | 34cf35051a36d24beb8bdb6e2e427e9a5eeceeeb (diff) |
Dmitry Kurochkin's pipelining close-down segfault fix
-rw-r--r-- | lib/multi.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/multi.c b/lib/multi.c index e531dd60b..f52cce5df 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -584,13 +584,18 @@ CURLMcode curl_multi_remove_handle(CURLM *multi_handle, 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; + /* Set connection owner so that Curl_done() closes it. + We can sefely do this here since connection is killed. */ + 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 |