1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-17 15:05:02 -05:00

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

View File

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