On Wed, 14 Oct 2020, Jeff Mears via curl-library wrote:

we're supposed to immediately call curl_multi_socket_action with CURL_SOCKET_TIMEOUT after starting a request.

* Is it actually necessary to do this?

No, it's not strictly necessary but not doing so might delay the start of that individual transfer.

When you add an easy handle to the multi handle, it doesn't actually kick off the transfer. It is just puts it in a queue and sets a timeout to expire immediately. When curl_multi_socket_action() subsequently is called, that new handle's timeout will be detected and its transfers will get going.

* How does this interact with an existing timeout that curl set before the handle was added? Do we continue to fire that later, or do we cancel it?

When curl sets a timeout with CURLMOPT_TIMERFUNCTION, that's a single timeout (and single-shot) you hold and tell curl about when it expires. If curl then needs *another* timeout, it will set a new one using the same callback. It might also update (or cancel) the timeout even before the existing one times out and then you modify the existing one. libcurl only asks that the application maintains a single timeout.

--

 / 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.haxx.se/mail/etiquette.html

Reply via email to