cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Bug in curl multi DONE->COMPLETED state transition?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 7 Aug 2008 09:11:15 +0200 (CEST)

On Thu, 7 Aug 2008, Josef Drexler wrote:

>> No, when it fires you don't set another timeout by yourself, but you should
>> pretty soon get a new timeout callback for the next timer.
>
> How? If no other events happen, libcurl's socket interface won't be called
> again after the timeout expires.

No, but when one timeout fires you call libcurl again and if there is a
pending next timeout the callback will be called with an updated timer. If
there is no pending timeout, well then there simply is no more timeouts.

> Yeah. Though DNS lookups will regularly time out, and connection attempts too
> when the server or the network is down.

... and then there are timeouts used, yes.

> I know that rtorrent will call libcurl with CURL_SOCKET_TIMEOUT exactly once
> for every time the timeout callback is triggered (unless a timeout was
> already pending, in which case it is replaced with the new value). They are
> in fact scheduled asynchronously, contrary to what he wrote in an earlier
> message. When the timeout value is zero, the CURL_SOCKET_TIMEOUT call
> doesn't happen until all other pending events have been handled. Then it
> will be called just before we'd wait for new events to happen (unless of
> course a different timeout value has been set because of handling the other
> events). But that should be fine, right?

Yes, that sounds like a description of how things should work! What libcurl
version are you using?

-- 
  / daniel.haxx.se
Received on 2008-08-07