cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Curl_done() is broken for pipelined connections

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 28 Jan 2008 16:28:00 +0100 (CET)

On Mon, 28 Jan 2008, Dmitry Kurochkin wrote:

>> What about adding a counter so that each Curl_do() increases a counter and
>> Curl_done() decreases it so that the actual cleanup act is only done once
>> it reaches zero again which then should be the last action in a pipeline?
>
> If server sends "Connection: close" we should close connection after this
> response even if we have over requests in pipeline (and counter is not
> zero).

True, we just need to make sure that we don't do things twice that can't deal
with it, or that we release any resource before the last user of it is done.

> And do we need the counter at all? Can we use send_pipe + recv_pipe size
> instead? If it is zero, then no requests are using this connection at the
> moment, so we can cleanup.

Yes, it seems totally reasonable to me.

However, I feel that these changes are probably not at an end here, and they
may also need some time to mature so I'll proceed and release 7.18.0 without
this, and then we can work on getting the pipelining perfected for the next
release...

Release is due to happen tonight CET.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2008-01-28