cURL / Mailing Lists / curl-library / Single Mail


Re: libcurl/openssl crashes when remote site partially goes down

From: Daniel Stenberg <>
Date: Thu, 17 Jan 2008 16:36:17 +0100 (CET)

On Thu, 17 Jan 2008, Magnus Cederlöf wrote:

>> The problem is that there's SIGPIPE sent to the app that seems to arrive
>> when curl_easy_cleanup() is called and that is actually caused by OpenSSL
>> that writes to the socket...
>> As a quick fix, you can just make your app ignore those. I'm not really
>> sure how to force openssl to not cause this to happen.

> However, it would be even better if libcurl/openssl could be failsafe and
> just return an error code for problems related to the remote site. If I
> could wish.... :-)

Right, which is why I said that it is a "quick fix" (not a proper solution)
and I also mentioned that I don't know how to fix it nicely.

The only way I know we can do this is to ignore/unignore SIGPIPE around all
function calls to openssl within libcurl and that is not very nice. libcurl
itself doesn't cause SIGPIPEs and when built with GnuTLS we've also managed to
properly avoid them.

So, we need to figure out if/how we can tell openssl to not cause these
signals to come.

  Commercial curl and libcurl Technical Support:
Received on 2008-01-17