]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
easy: ignore sigpipe in curl_easy_send
authorDaniel Stenberg <daniel@haxx.se>
Mon, 26 Apr 2021 07:58:23 +0000 (09:58 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 26 Apr 2021 11:22:20 +0000 (13:22 +0200)
Closes #6965

lib/easy.c

index 3deb69a9affdf0d9cef0e8b749b0d2b25b32cd10..8983dbccec7c3ad5816b279460f8960b03f9f30d 100644 (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;