cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: SIGPIPE downloading with redirection

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 7 Jan 2013 00:06:00 +0100 (CET)

On Sun, 6 Jan 2013, Lluís Batlle i Rossell wrote:

>> What on earth would it try to write to it at that point? Can you
>> strace it and see what the offending attempted write is?
>
> No idea. Even using 'http' moves to 'https', and then it sends something
> ciphered. '5' is the file written to disk. '3' is the first socket. Maybe
> SSL closing sends something?

Ah yes indeed. It redirects to HTTPS and you're indeed most likely seeing an
attempted SSL shutdown sequence.

> write(3,
> "\25\3\1\0\26\244.\177\332\331;\4}U\222\305\305\7\322\360\345\350;\326\264\221\n",
> 27) = -1 EPIPE (Broken pipe)

If I'm not mistaken, you're using a curl built to use OpenSSL which doesn't
really allow us to use it without risk an EPIPE. The real fix here (apart from
adding this ability to OpenSSL) I think, is to make sure that curl adds a
signal handler that ignores EPIPE...

(That's unfortunately not the real fix for libcurl though, but I generally
blame OpenSSL for now providing this feature, at least GnuTLS for example
allows us to avoid it completely.)

> Notice that 'curl' did not output any string to stdout/stderr about the
> SIGPIPE, so it can be seen only by the exit code.

Oops, sorry for missing that little detail and yes it did repeat in my end (I
get exit code 141 but no error message of any kind).

I guess the server has shut already down the connection by the time curl sends
the SSL shutdown.

-- 
  / daniel.haxx.se

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-01-07