cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: SIGPIPE when uploading with CURLOPT_READDATA

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Fri, 8 Oct 2004 11:27:20 +0200 (CEST)

On Thu, 7 Oct 2004 apinstein_at_mac.com wrote:

>> ssize_t send(int s, const void *msg, size_t len, int flags);
>
> However, it doesn't indicate that MSG_NOSIGNAL is valid...

This is indeed an interesting venture. Look what I found:

(http://lists.apple.com/archives/macnetworkprog/2002/Dec/msg00091.html)

--- start ---
Mac OS X does not support the flag MSG_NOSIGNAL but we have an equivalent.

Starting with version 10.2 (Jaguar), Mac OS X has the socket option
SO_NOSIGPIPE that prevents SIGPIPE from being raised when a write fails on a
socket to which there is no reader; instead the write to the socket returns
with the error EPIPE.
--- stop ---

Thus, we should check for SO_NOSIGPIPE and use that. If I make a fix for this,
can you try it out?

-- 
      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-08