aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-12-03 15:20:27 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-12-03 15:20:27 +0000
commit479ddb1fee2fa5f7204a64742e9dcc2842d668dd (patch)
tree740adc5007ea4c181aef62bcca2c4bca97ab6c5e /lib/url.c
parent4ee27b4594ab2f326a431d11a014991b712d1927 (diff)
- Igor Novoseltsev filed bug #2351645
(http://curl.haxx.se/bug/view.cgi?id=2351645) that identified a problem with the multi interface that occured if you removed an easy handle while in progress and the handle was used in a HTTP pipeline.
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/url.c b/lib/url.c
index 6bb3e3ee7..9037bf920 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -2359,6 +2359,20 @@ int Curl_removeHandleFromPipeline(struct SessionHandle *handle,
return 0;
}
+/* remove the specified connection from all (possible) pipelines and related
+ queues */
+void Curl_getoff_all_pipelines(struct SessionHandle *data,
+ struct connectdata *conn)
+{
+ if(Curl_removeHandleFromPipeline(data, conn->recv_pipe) &&
+ conn->readchannel_inuse)
+ conn->readchannel_inuse = FALSE;
+ if(Curl_removeHandleFromPipeline(data, conn->send_pipe) &&
+ conn->writechannel_inuse)
+ conn->writechannel_inuse = FALSE;
+ Curl_removeHandleFromPipeline(data, conn->pend_pipe);
+}
+
#if 0 /* this code is saved here as it is useful for debugging purposes */
static void Curl_printPipeline(struct curl_llist *pipeline)
{
@@ -4548,13 +4562,7 @@ CURLcode Curl_done(struct connectdata **connp,
Curl_expire(data, 0); /* stop timer */
- if(Curl_removeHandleFromPipeline(data, conn->recv_pipe) &&
- conn->readchannel_inuse)
- conn->readchannel_inuse = FALSE;
- if(Curl_removeHandleFromPipeline(data, conn->send_pipe) &&
- conn->writechannel_inuse)
- conn->writechannel_inuse = FALSE;
- Curl_removeHandleFromPipeline(data, conn->pend_pipe);
+ Curl_getoff_all_pipelines(data, conn);
if(conn->bits.done ||
(conn->send_pipe->size + conn->recv_pipe->size != 0 &&