cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Curl, threading and gethostbyname

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 26 Aug 2010 23:41:18 +0200 (CEST)

On Thu, 26 Aug 2010, Christian Mauduit wrote:

> I have a mutex for my own calls gethostbyname (so that my program
> serializes its calls to it, for various reasons I prefer this than using
> gethostbyname_r which, among other things, isn't portable)

Just a note that when libcurl is built with the native resolver and ipv4 only,
it will use gethostbyname_r but its "unportability" is not a problem for
libcurl since we support all existing different flavours of it...

> "curl_easy_setopt (curl_handle, CURLOPT_NOSIGNAL, 1);"
> since I read it could help multithreaded UNIX applications (my case).
>
> So far I didn't reproduce the problem with CURLOPT_NOSIGNAL set

If you use a timeout in your application that could very well explain the
crash and the subsequent fix with CURLOPT_NOSIGNAL, as libcurl uses signals to
timeout name synch resolves by default.

Oh, and you didn't mention which libcurl version you use or what OS you run
on...

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-08-26