diff options
author | Daniel Stenberg <daniel@haxx.se> | 2006-10-09 06:58:05 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2006-10-09 06:58:05 +0000 |
commit | a1de9367ecc17ae1d77e46b76fb1aba6c9f3ccb2 (patch) | |
tree | 93b73d1132cd1fd9bf234cb5989b5fb9f5fb8712 /lib/url.c | |
parent | eceb37bde2a0a5ce6be3a141d8d420be28a12fa0 (diff) |
Bogdan Nicula's second test case (posted Sun, 08 Oct 2006) converted to test
case 535 and it now runs fine. Again a problem with the pipelining code not
taking all possible (error) conditions into account.
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -1840,7 +1840,7 @@ void Curl_addHandleToPipeline(struct SessionHandle *data, } -void Curl_removeHandleFromPipeline(struct SessionHandle *handle, +int Curl_removeHandleFromPipeline(struct SessionHandle *handle, struct curl_llist *pipe) { struct curl_llist_element *curr; @@ -1849,10 +1849,11 @@ void Curl_removeHandleFromPipeline(struct SessionHandle *handle, while (curr) { if (curr->ptr == handle) { Curl_llist_remove(pipe, curr, NULL); - break; + return 1; /* we removed a handle */ } curr = curr->next; } + return 0; } #if 0 @@ -3975,8 +3976,14 @@ CURLcode Curl_done(struct connectdata **connp, conn->bits.done = TRUE; /* called just now! */ - /* cleanups done even if the connection is re-used */ + if(Curl_removeHandleFromPipeline(data, conn->recv_pipe) && + conn->readchannel_inuse) + conn->readchannel_inuse--; + if(Curl_removeHandleFromPipeline(data, conn->send_pipe) && + conn->writechannel_inuse) + conn->writechannel_inuse--; + /* cleanups done even if the connection is re-used */ if(data->reqdata.rangestringalloc) { free(data->reqdata.range); data->reqdata.rangestringalloc = FALSE; |