cURL / Mailing Lists / curl-library / Single Mail


Re: RFC: libcURL and persistent connection management

From: Ryan Beasley <>
Date: Tue, 24 Jan 2012 17:43:57 -0800

(Apologies for the delay. Was on holiday over the weekend.)

On 01/20/2012 03:00 PM, Daniel Stenberg wrote:
> I would set the tag on the easy handle and it would then tag the
> connection it subsequently uses. When I later on ask libcurl to
> "cleanup" the tag, libcurl marks all such connections to either get
> closed at once if they are in the connection pool, or get marked to
> get closed after use if they are then currently used by any ongoing
> transfer?


> Sounds like a lovely feature. We could perhaps also have the cleanup
> function return some info about how many connections it closed/marked.
> I have one incomplete thought that brings more work and makes this
> feature a bit harder to implement: how to handle connections that need
> some actions to get closed. Like for example FTP that sends a "QUIT".
> We probably need to give the cleanup function a non-blocking API
> somehow. I'm already suffering a mental pain from not having thought
> about that for curl_multi_remove_handle() which has this problem and
> one of these days I will have to introduced a new API call in order to
> handle exactly that...

Yeah, non-blocking support is mandatory. I'll have to take another few
passes over the connection management internals in order to see a) how
this would best fit in and b) be easy to understand & use.

I'll start scoping/planning & check in w/ my mgmt and will get back to
you (hopefully) soon.


   - Ryan
List admin:
Received on 2012-01-25