aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-12-12 12:04:10 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-12-12 12:04:10 +0000
commit3ca360391a2045a222b36ac1f0e454a02d354d97 (patch)
tree77f2fb6110099db701121247bd1bcc87687b80e8 /lib/url.c
parent5f0a3797c9e04840c887a885cad3a4e66ce9ff38 (diff)
Make the getoff all pipelines function only set _inuse to FALSE if the
specified data pointer was head.
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/lib/url.c b/lib/url.c
index 0f25a9d3e..099a4a5af 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -2378,20 +2378,6 @@ 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)
{
@@ -2416,6 +2402,24 @@ static struct SessionHandle* gethandleathead(struct curl_llist *pipeline)
return NULL;
}
+/* remove the specified connection from all (possible) pipelines and related
+ queues */
+void Curl_getoff_all_pipelines(struct SessionHandle *data,
+ struct connectdata *conn)
+{
+ bool recv_head = conn->readchannel_inuse &&
+ (gethandleathead(conn->recv_pipe) == data);
+
+ bool send_head = conn->writechannel_inuse &&
+ (gethandleathead(conn->send_pipe) == data);
+
+ if(Curl_removeHandleFromPipeline(data, conn->recv_pipe) && recv_head)
+ conn->readchannel_inuse = FALSE;
+ if(Curl_removeHandleFromPipeline(data, conn->send_pipe) && send_head)
+ conn->writechannel_inuse = FALSE;
+ Curl_removeHandleFromPipeline(data, conn->pend_pipe);
+}
+
static void signalPipeClose(struct curl_llist *pipeline)
{
struct curl_llist_element *curr;