From befc30bc55cebe958d652ec4f5d31aa8565773c1 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 6 Oct 2006 21:19:57 +0000 Subject: Bogdan Nicula's hanging test case was converted to test case 533 and the test now runs fine. --- lib/multi.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'lib/multi.c') diff --git a/lib/multi.c b/lib/multi.c index 46fd255f3..620c08277 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -942,9 +942,14 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, case CURLM_STATE_WAITDO: /* Wait for our turn to DO when we're pipelining requests */ - infof(easy->easy_handle, "Connection #%d: send pipe size = %d\n", +#ifdef CURLDEBUG + infof(easy->easy_handle, "Conn %d send pipe %d inuse %d athead %d\n", easy->easy_conn->connectindex, - easy->easy_conn->send_pipe->size); + easy->easy_conn->send_pipe->size, + easy->easy_conn->writechannel_inuse, + Curl_isHandleAtHead(easy->easy_handle, + easy->easy_conn->send_pipe)); +#endif if (!easy->easy_conn->writechannel_inuse && Curl_isHandleAtHead(easy->easy_handle, easy->easy_conn->send_pipe)) { @@ -1232,6 +1237,11 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, * If an error was returned, and we aren't in completed state now, * then we go to completed and consider this transfer aborted. */ + if(easy->easy_conn) { + /* if this has a connection, unsubscribe from the pipelines */ + easy->easy_conn->writechannel_inuse = FALSE; + easy->easy_conn->readchannel_inuse = FALSE; + } multistate(easy, CURLM_STATE_COMPLETED); } } @@ -1345,7 +1355,6 @@ CURLMcode curl_multi_cleanup(CURLM *multi_handle) Curl_hash_destroy(multi->hostcache); Curl_hash_destroy(multi->sockhash); -#if 1 /* go over all connections that have close actions */ for(i=0; i< multi->connc->num; i++) { if(multi->connc->connects[i] && @@ -1367,7 +1376,6 @@ CURLMcode curl_multi_cleanup(CURLM *multi_handle) free(cl); cl= n; } -#endif Curl_rm_connc(multi->connc); -- cgit v1.2.3