summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-08-21 14:52:17 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-08-21 14:52:17 +0200
commit8e1b45939386eed31dc9b65924ccfd2b8f779b1e (patch)
tree2dff60b1c1e309260627a78bc1127f6bfaf3cd3f
parent362e9cc89bb9fa93a92f19c3fd3cf593998077c4 (diff)
downloadcurl-bagder/docs-threaded-SIGPIPE.tar.gz
libcurl-thread.3: expand somewhat on the NO_SIGNAL motivationbagder/docs-threaded-SIGPIPE
Multi-threaded applictions basically MUST set CURLOPT_NO_SIGNAL to 1L to avoid the risk of getting a SIGPIPE. Either way, a multi-threaded application that uses libcurl/openssl needs to have a signhandler for or ignore SIGPIPE on its own. Based on discussions in #2800
-rw-r--r--docs/libcurl/libcurl-thread.312
1 files changed, 9 insertions, 3 deletions
diff --git a/docs/libcurl/libcurl-thread.3 b/docs/libcurl/libcurl-thread.3
index c18676e7e..1433f63ff 100644
--- a/docs/libcurl/libcurl-thread.3
+++ b/docs/libcurl/libcurl-thread.3
@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 2015 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 2015 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
@@ -79,8 +79,14 @@ all handles. Everything will or might work fine except that timeouts are not
honored during the DNS lookup - which you can work around by building libcurl
with c-ares or threaded-resolver support. c-ares is a library that provides
asynchronous name resolves. On some platforms, libcurl simply will not
-function properly multi-threaded unless the \fICURLOPT_NOSIGNAL(3)\fP option is
-set.
+function properly multi-threaded unless the \fICURLOPT_NOSIGNAL(3)\fP option
+is set.
+
+When \fICURLOPT_NOSIGNAL(3)\fP is set to 1L, your application needs to deal
+with the risk of a SIGPIPE (that at least the OpenSSL backend can
+trigger). Note that setting \fICURLOPT_NOSIGNAL(3)\fP to 0L will not work in a
+threaded situation as there will be race where libcurl risks restoring the
+former signal handler while another thread should still ignore it.
.IP "Name resolving"
\fBgethostby* functions and other system calls.\fP These functions, provided
by your operating system, must be thread safe. It is very important that