cURL / Mailing Lists / curl-library / Single Mail


Re: cleanup half closed sockets in connection cache

From: Daniel Stenberg <>
Date: Tue, 13 Oct 2009 05:32:30 +0200 (CEST)

On Mon, 12 Oct 2009, Frank Meier wrote:

> I now liked to change that behavior, and didn't find a nice solution. First
> I wanted to remeber the sockets and then close it if I see that the socket
> has been closed by the peer. but this would bypass libcurl, and imho would
> be a hack. After further searching I've found a posting in this mailing
> list, dealing with a similiar problem:
> the patch included in this
> post removed all connections in close_wait before a new request

And that patch is merged into the main code since about that time.

> but still there will be at least one (the last) connection, that will remain
> in close_wait state "forever".

So you're actually thinking it is worth adding an entirely new function and
code in your app to call that function with some interval just to make sure
there's a single socket being closed correctly?

I personally do not. I would rather prefer to see that scanning to be done
possibly on some other event and not only when adding a new connection, so
that the possibility that it gets discovered and closed increases but without
adding anything new to the API and without doing the check too often.

List admin:
Received on 2009-10-13