curl / Mailing Lists / curl-library / Single Mail


Re: Curl and c-ares block during curl_multi_remove_handle

From: Evgen Bodunov via curl-library <>
Date: Mon, 19 Nov 2018 15:45:40 +0300

>> Before
>> curl_multi_remove_handle(_multi, task->getCurl());
>> But I believe curl should take care on cancelling active easy handler
>> somewhere inside curl_multi_remove_handle. May be I’m wrong.
> Have you figured out exactly which function in libcurl that waits if you don't
> do this?

   frame #3: 0x00000001036a65a4 GalileoPro`Curl_resolver_wait_resolv(conn=0x000000010b84c208, entry=0x0000000000000000) at asyn-ares.c:395
   frame #4: 0x00000001036894c4 GalileoPro`multi_done(connp=0x0000000109823818, status=CURLE_OK, premature=true) at multi.c:541

As you may see in backtrace in original message. Curl_resolver_wait_resolv is called inside multi_done. Curl_resolver_wait_resolv computes timeout value and sets it to default 1 second if it’s bigger. If small (1) timeout is set prior to curl_multi_remove_handle, then waitperform called with 0 timeout and returns instantly without 1 second delay.

Evgen Bodunov.

Received on 2018-11-19