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: Question regarding passing CURL_SOCKET_TIMEOUT to multi_socket_action

From: Yongkang Huang via curl-library <>
Date: Mon, 25 Oct 2021 02:27:42 +0000

Thanks a lot Daniel, those information are really helpful and resolved my questions.

From: Daniel Stenberg <>
Date: Sunday, October 24, 2021 at 12:40 PM
To: Yongkang Huang <>
Cc: Yongkang Huang via curl-library <>
Subject: Re: Question regarding passing CURL_SOCKET_TIMEOUT to multi_socket_action
On Sun, 24 Oct 2021, Yongkang Huang wrote:

> For 1), will the CURLMOPT_TIMERFUNCTION callback called in this case?

The CURLMOPT_TIMERFUNCTION callback is called when the timeout needs updating.
If the number of transfers is zero, that should mean that there's no timeout

> For 2), that make a lot of sense, I know there¢s some code indicating added
> easy handle error like CURLM_BAD_EASY_HANDLE, in this case how to know which
> easy handle is bad so we can remove from the multi without terminate other
> good handles?

I don't think curl_multi_socket_action can return CURLM_BAD_EASY_HANDLE
without something is seriously messed up.

> Also for curl_multi_socket_action, which error would indicate the multi
> handle is corrupted and we need to clear all the added easy handle?

None? The multi handle cannot get "corrupted" without something having run
berserk and if something has, then curl cannot detect it anyway.

  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features

Received on 2021-10-25