cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURLOPT_TIMEOUT and SIGALRM

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 24 Jan 2003 17:23:03 +0100 (CET)

On Fri, 24 Jan 2003, Ward, David wrote:

> I'm using curl library 7.9.2 on solaris 7 in a C++ pthread application and
> I'm not seeing the expected behaviour regarding CURLOPT_TIMEOUT and it
> dependence on SIGALRM in a multithreaded environment. As the documentation
> indicates a problem using the timeout with threads I want to demonstrate
> the problem. I'm disabling signals on my threads but the timeout option
> still appears to work - is the timeout really using SIGALRM? I cant set
> the CURLOPT_NOSIGNAL option available in later versions of curl. Can
> anyone shed any light on what is going on here?

Yes. The signal is used for stopping slow DNS name resolves, nothing else.
So, if you don't "hang" in the name resolve for very long, then it won't
abort with a signal but just a normal comparison and a return.

Also, exactly how your operating system treats a signal that arrives when you
run multiple threads seem to vary a lot between different systems.

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Received on 2003-01-24