cURL / Mailing Lists / curl-library / Single Mail


Re: timeout

From: Daniel Stenberg <>
Date: Wed, 24 Jan 2001 18:09:33 +0100 (MET)

On Wed, 24 Jan 2001, Johan Nilsson wrote:

> I use libcurl and I think I've completely missunderstood the timeout
> setting...
> I thought it had to do with a request sent to a server, i.e. curl should
> wait a maximum of timeout seconds for a server response. But it seems
> that this has to deal with the complete transfer, i.e. a timeout of 30
> seconds would automatically abort my ftp transfer after 30 seconds (Why
> would anyone want this feature?).

Well, when it comes to TCP it is often very tricky to know when the other end
dies or just goes not-sending-any-more. If you have some kind of automatic
job, it can be handy to abort it if it takes too long.

Feel free to add a timeout that does what you thought it did. I'm sure more
than you would like such a one. I'd appriciate a patch!

> * How long will (lib)curl wait for a server response?

Without the timeout specificly set, it doesn't use any timers at all apart
from those the OS itself will use on system/network calls.

> * What do I do to disable timeout? Is it disabled by default?

It is disabled by default. Setting it to zero disables it.

> * Is progress callback triggered even though curl is waiting for a
> response?

The progress callback is called as soon as libcurl enters the transfer
section. No matter if it receives data or not. Thus, if you for example
requests a FTP file and the connection is veeeery slow it can take a while
before the first progress callback is done. There might be reasons to change

  Daniel Stenberg -- curl project maintainer --
Curl-library mailing list
Received on 2001-01-24