cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Connection being reused following a cancellation (HTTP)

From: Vladimir Grishchenko <vladgri_at_hotmail.com>
Date: Thu, 29 Sep 2011 12:08:26 -0700

> On Tue, 27 Sep 2011, Vladimir Grishchenko wrote:
>
> > Is it possible that an early cancellation request (i.e. first call to the
> > progress callback function) may leave a connection open and available for
> > reuse despite the fact the headers were already sent out (HTTP)? This is
> > using the multi-intreface. We are still on 7.21.3, I looked at the change
> > log for later releases and couldn't find any bug fixes that were obviously
> > related to this.
>
> You're asking if a bug is possible? Yes, it is.
>
> I don't think we've seen any reports about it before though. Can you try to
> write up a recipe we can use to repeat it?
>

I know I owe you a reproducible test case but here is some additional details. Basically we call curl_multi_perform() during which libcurl calls back to the installed progress callback which says please cancel. Upon return from curl_multi_perform() we check if there are any completed transfers by calling curl_multi_info_read(), at that point we get CURLMSG_DONE for the just cancelled handle and we proceed with removal of the easy by calling curl_multi_remove_handle(). As far as I can tell in that call Curl_done() gets called at some point but the close connection bit is not set and we get "Connection #%ld to host %s left intact", but only in early cancellation cases and only if a previous open connection is being reused for this new request.
                                               

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-09-29