cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH] suggested SIGPIPE handling for libcurl

From: Ben Greear <greearb_at_candelatech.com>
Date: Mon, 11 Mar 2013 15:06:55 -0700

On 03/11/2013 02:54 PM, Daniel Stenberg wrote:
> Hi friends,
>
> In bug #1180 [1], we have a clear case where we get a SIGPIPE and there's currently no way for libcurl to deal with it nicely. This is because the actual
> offending write() (or similar) call is made from within OpenSSL. I suspect other 3rd party libs we use may be able to do the same thing.
>
> The only work-around we have up until now is to recommend that the libcurl- using applications themselves ignore SIGPIPE. That's also what the curl tool does
> now so that it won't die as easily from this problem.
>
> I've written a small patch that shows my suggested fix. It is two functions that should be called on libcurl-entry and libcurl-exit for all libcurl functions
> that risk causing a SIGPIPE. The functions will switch on sigpipe ignoring and then switch back the "outside's" situation again on exit.

Maybe change SIGPIPE_IGNORE to
CURL_SIGPIPE_IGNORE to make sure you don't chance upon
some other header file defining that?

Thanks,
Ben

-- 
Ben Greear <greearb_at_candelatech.com>
Candela Technologies Inc  http://www.candelatech.com
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2013-03-11