Buy commercial curl support from WolfSSL. We help you work
out your issues, debug your libcurl applications, use the API, port to new
platforms, add new features and more. With a team lead by the curl founder
himself.
Re: curl_easy_recv and SIGPIPE
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Tue, 27 Oct 2020 13:33:25 +0100 (CET)
On Tue, 27 Oct 2020, Tomalak Geret'kal via curl-library wrote:
>> What did you see? From where is the SIGPIPE and was SO_NOSIGPIPE set on
>> that socket?
>>
> I've said already: from the recv call in curl_easy_recv.
>
> And yes it was.
Curious - in two parts.
1. SIGPIPE is typically generated when tring to send data on a socket without
a reader, not when reading.
But since you speak of "the recv call in curl_easy_recv" and there is no
"recv" call in that function, I assume you refer to the Curl_read() call? That
can in itself end up writing to the socket if that's what the TLS library
wants. Sound reasonable?
2. SO_NOSIGPIPE is documented in Apple's own iOS documentation[*] as:
SO_NOSIGPIPE is an option 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 when there is no reader.
... so if SO_NOSIGPIPE truly was set on that socket, this sounds like Apple's
bug?
[*] =
https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getsockopt.2.html
Date: Tue, 27 Oct 2020 13:33:25 +0100 (CET)
On Tue, 27 Oct 2020, Tomalak Geret'kal via curl-library wrote:
>> What did you see? From where is the SIGPIPE and was SO_NOSIGPIPE set on
>> that socket?
>>
> I've said already: from the recv call in curl_easy_recv.
>
> And yes it was.
Curious - in two parts.
1. SIGPIPE is typically generated when tring to send data on a socket without
a reader, not when reading.
But since you speak of "the recv call in curl_easy_recv" and there is no
"recv" call in that function, I assume you refer to the Curl_read() call? That
can in itself end up writing to the socket if that's what the TLS library
wants. Sound reasonable?
2. SO_NOSIGPIPE is documented in Apple's own iOS documentation[*] as:
SO_NOSIGPIPE is an option 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 when there is no reader.
... so if SO_NOSIGPIPE truly was set on that socket, this sounds like Apple's
bug?
[*] =
https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getsockopt.2.html
-- / daniel.haxx.se | Commercial curl support up to 24x7 is available! | Private help, bug fixes, support, ports, new features | https://www.wolfssl.com/contact/ ------------------------------------------------------------------- Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.htmlReceived on 2020-10-27