cURL / Mailing Lists / curl-library / Single Mail


RE: Keepalive

From: Gabriel Kälin <>
Date: Tue, 18 Mar 2008 09:23:17 +0100

> -----Original Message-----
> From:
> [] On Behalf Of
> Daniel Stenberg
> When the time comes and libcurl wants to re-use a connection,
> it first checks
> if the connection seems dead and if so it kills it and
> creates a fresh one
> instead. At times it'll even try to use the connection only
> to find it died
> and then it creates a new one.

I'm wondering how curl decides whether a connection is dead if it hasn't received any FIN-packets from the server. I've seen cases where libcurl tried to re-use an old TCP-connection that had been dropped by a stateful firewall between the client and the server. In that case curl seems to block indefinitely instead of establishing a new TCP connection. How does an easy handle cope with this situation?

How can curl avoid this situation without stopping to re-use connections? The only way I see would be CURLOPT_LOW_SPEED_LIMIT and CURLOPT_LOW_SPEED_TIME. Am I missing an obvious solution to this problem?


Received on 2008-03-18