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: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Mon, 5 Apr 2021 22:43:09 +0200 (CEST)

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.

-- 
  / 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