easy: ignore sigpipe in curl_easy_send

Closes #6965
This commit is contained in:
Daniel Stenberg 2021-04-26 09:58:23 +02:00
parent 9ec1ef7f41
commit f154ae9de3
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
1 changed files with 3 additions and 0 deletions

View File

@ -1171,6 +1171,7 @@ CURLcode curl_easy_send(struct Curl_easy *data, const void *buffer,
CURLcode result;
ssize_t n1;
struct connectdata *c = NULL;
SIGPIPE_VARIABLE(pipe_st);
if(Curl_is_in_callback(data))
return CURLE_RECURSIVE_API_CALL;
@ -1185,7 +1186,9 @@ CURLcode curl_easy_send(struct Curl_easy *data, const void *buffer,
Curl_attach_connnection(data, c);
*n = 0;
sigpipe_ignore(data, &pipe_st);
result = Curl_write(data, sfd, buffer, buflen, &n1);
sigpipe_restore(&pipe_st);
if(n1 == -1)
return CURLE_SEND_ERROR;