cURL / Mailing Lists / curl-library / Single Mail


Re: libcurl - No timeout

From: Daniel Stenberg <>
Date: Sun, 18 Jul 2004 09:28:54 +0200 (CEST)

On Sat, 17 Jul 2004, Roland Krikava wrote:

>> First off, what is a "legitimate connection" and how can libcurl tell?
> If data is available for reading, I would call this legitimate.

Data is not available all the time, hardly on any connections. There are
always periods when no data is available. The lengths of those periods can of
course vary between milliseconds to hours, days or even weeks. The periods of
no-data-available doesn't make the connection ilegitimate, only slow.

> Large files that take a long time to download could outlast any

Of course, CURLOPT_TIMEOUT is a very rough tool.

> If, however, this timeout was used instead to timeout on inactive
> connections, this problem would be avoided.

So what is an "inactive connection" ? libcurl can't tell if the server is
slow, the network is slow or if the server actually decided to stop sending
data (without disconnecting).

But then, libcurl offers a method to kill connections with very little
through-put, if you think that is a good idea. Or you can do your own
heuristics in one of the callbcks libcurl calls.

      Daniel Stenberg -- --
       Dedicated custom curl help for hire:
Received on 2004-07-18