cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Lib curl and signals

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 3 Oct 2001 11:57:32 +0200 (MET DST)

On Wed, 3 Oct 2001, Bescon, Guenole wrote:

> What kind of signals are sent by libcurl ?

To offer timeouts, libcurl uses SIGALRM used by alarm(). If you don't set any
timeout, that one will not be used. Also, the alarm() is disabled as soon as
the connection phase is passed (in the upcoming 7.9.1, it will only be used
for the name resolving and nothing else).

Signals should not be used in multi-threaded programs why timeouts are
trickier then.

> In which circumtances these signals are sent ?

Another signal that might get sent that is not (yet) trapped by libcurl is
the SIGPIPE that can get sent to the (process using) libcurl when write()ing
to a socket and the other end dies.

> Is it a way to disable the sending of these signals ?

The alarm one by not using timeouts, the SIGPIPE by issuing:

  (void) signal(SIGPIPE, SIG_IGN);

Anyone with a reason to *NOT* add that SIGPIPE ignore to libcurl?

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-10-03