cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: SIGPIPE when uploading with CURLOPT_READDATA

From: Jamie Lokier <jamie_at_shareable.org>
Date: Mon, 11 Oct 2004 13:45:59 +0100

Daniel Stenberg wrote:
> >Attached is a first attempt of a fix for this problem. Should prevent
> >SIGPIPEs on systems that have SO_NOSIGPIPE.
>
> Is Alan the only Mac OS X user around?
>
> This is the final issue I have on my list to fix before the release so I
> would appreciate _some_ feedback on my approach. At least that it compiles
> fine!

Fwiw, I believe SO_NOSIGPIPE is also FreeBSD 5 option.
It isn't mentioned in the FreeBSD man pages, but it is in the header files.

In your patch, you write:

 setsockopt(sockfd, IPPROTO_TCP, SO_NOSIGPIPE, (void *)&onoff, sizeof(onoff));

However, without testing, unless you've seen an example of this
working in another program, you might find it's not a TCP-layer
option. I.e. you might find it has to say SOL_SOCKET instead; I don't know.

Fwiw I don't use Mac OS or FreeBSD; I just thought I'd pass this bit
of info along.

-- Jamie
Received on 2004-10-11