cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl and SIGALRM

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 3 Dec 2002 10:20:27 +0100 (MET)

On Tue, 3 Dec 2002, Nilesh Simaria wrote:

> I am using libcurl for ftpupload and ftpdownload. Sometimes I am able to
> upload file successfully, and sometimes I am getting error No 28, "Transfer
> aborted due to select() error".

select error? Weird. Can you add a check for what 'errno' contains when that
happens? (around line 250 in lib/ftp.c)

> But when I remove code which sends SIGALRM, ftpupload works fine.

Which code is this? The timeout code in libcurl or are you talking about some
other code?

> But the code which sends SIGALRM everyafter 1 sec is very important in my
> application. How can I go with both, libcurl and alarm.

You must make sure that your signal handler that receives the SIGALRM does
not abort the system call. SA_RESTART is the key to success!

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T 
handheld. Power & Color in a compact size! 
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
Received on 2002-12-03