curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: curl_multi_timeout and the multi_socket API

From: Henrik Holst via curl-library <curl-library_at_cool.haxx.se>
Date: Mon, 5 Apr 2021 22:45:02 +0200

Den mån 5 apr. 2021 kl 22:43 skrev Daniel Stenberg <daniel_at_haxx.se>:

> On Mon, 5 Apr 2021, Henrik Holst wrote:
>
> > And this particular run with 1ms did not lead to 100% cpu, it was when
> curl
> > gave me 0ms as timeout as the last timeout which lead me to call
> > curl_multi_socket_action() every 0ms, which turned it into a busy wait
> loop
> > and hence the 100% cpu. Shouldn't curl return -1 as infinte timeout
> instead
> > there since it's waiting for read on a connected socket (after having
> sent
> > the request in full) with no defined CURLOPT_TIMEOUT?
>
> 0 means that there's a timeout pending that libcurl wants to take care of
> at
> once so then it can't return -1 since -1 means no timeout at all.
>
> So no, it cannot return -1 when it means 0.
>
Yeah, it turned out that my whole problem was that i misread the docs
"non-repeating timer" as "repeating timer" and that was the whole basis for
my confusion.

Sorry for this.

/HH

>
> --
>
> / daniel.haxx.se
> | Commercial curl support up to 24x7 is available!
> | Private help, bug fixes, support, ports, new features
> | https://www.wolfssl.com/contact/
>


-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.se/mail/etiquette.html
Received on 2021-04-05