cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: SIGPIPE when uploading with CURLOPT_READDATA

From: <apinstein_at_mac.com>
Date: Thu, 7 Oct 2004 14:25:44 -0400

> Well, the question is more if Mac OS X supports that option for send().

Ok, I finally got around to checking for this, and it does seem that
send supports the fourth parameter (flags):

> ssize_t send(int s, const void *msg, size_t len, int flags);

However, it doesn't indicate that MSG_NOSIGNAL is valid...

> The flags parameter may include one or more of the following:
>
> #define MSG_OOB 0x1 /* process out-of-band data */
> #define MSG_DONTROUTE 0x4 /* bypass routing, use direct
> interface */
>
> The flag MSG_OOB is used to send ``out-of-band'' data on sockets
> that
> support this notion (e.g. SOCK_STREAM); the underlying protocol
> must
> also support ``out-of-band'' data. MSG_DONTROUTE is usually used
> only by
> diagnostic or routing programs.

Any thoughts? Should I just try catching the SIGPIPE errors on the
threads running libcurl to prevent the thread from crashing?

Thanks,
ALan

On Sep 30, 2004, at 11:36 AM, Daniel Stenberg wrote:

> On Thu, 30 Sep 2004, Alan Pinstein wrote:
>
>>> Does this system have MSG_NOSIGNAL defined? If you check lib/setup.h
>>> libcurl uses this argument to its send() calls if it is present:
>
>> Hmmm I don't know... lib/setup.h is a CURL source file?
>
> libcurl source, yes.
>
>> I build from fink so it'll take some twiddling to figure out if this
>> is going on...
>
> Well, the question is more if Mac OS X supports that option for send().
>
>> Also, is MSG_NOSIGNAL a configure option?
>
> No, it is defined in your system headers.
>
>> What's the definitive way to tell if it's being used?
>
> I'm not sure this is the "definitive way" - but 'man send' should
> describe it.
>
>> How is this related to curl_easy_setopt's CURLOPT_NOSIGNAL?
>
> Not at all really. CURLOPT_NOSIGNAL set true avoids the use of signals
> to abort stuff for timeouts.
>
>>> Have you tried to simply have your app ignore SIGPIPE?
>>
>> Hmm I haven't. Actually it's an interesting idea... I'll have to see
>> how to catch signals from Cocoa :)
>
> That is way beyond my horizon! ;-)
>
> --
> Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
> Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-10-07