Daniel Stenberg <[email protected]> wrote:
> > I debugged into the curl-library and I discovered that when
> > multi_handle_timeout() detects a timeout, it calls the Curl_resolver_kill().
> >
> > The Curl_resolver_kill() awaits then 11 seconds for Curl_thread_join().
> 
> ... I think we should consider providing a way for libcurl to *not* wait for 
> that final thread and continue anyway and that way avoid this "hang" - even 
> if that then also risks causing a memory leak.

I did a test in this direction.

I set data->result in multi_handle_timeout() and then in case of non-zero in
Curl_resolver_kill() I simple avoided calling the Curl_thread_join().

--------------------------------------------
...
/* wait for the thread to resolve the name if no error already occurred */
if (data->result == CURLE_OK) {
  if (Curl_thread_join(&td->thread_hnd))
  {
    if (entry)
      result = getaddrinfo_complete(data);
  }
...
--------------------------------------------

It was just a test and it worked, but obviously it raises more doubts than
those it solves... :-)

--
Best regards.
Woody from WiBu Systems AG.

-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Reply via email to