aboutsummaryrefslogtreecommitdiff
path: root/lib/multihandle.h
diff options
context:
space:
mode:
authorGergely Nagy <ngg@tresorit.com>2019-11-17 15:12:15 +0100
committerDaniel Stenberg <daniel@haxx.se>2019-11-25 15:45:56 +0100
commitf3c35e371cc70f1b6bc33f7faa904d37d1567eb3 (patch)
tree3c7668dec5726aa510d7be282ff440c9ee370802 /lib/multihandle.h
parent0a65febccf0e31bc987be3f90c01194804e61b77 (diff)
multi: add curl_multi_wakeup()
This commit adds curl_multi_wakeup() which was previously in the TODO list under the curl_multi_unblock name. On some platforms and with some configurations this feature might not be available or can fail, in these cases a new error code (CURLM_WAKEUP_FAILURE) is returned from curl_multi_wakeup(). Fixes #4418 Closes #4608
Diffstat (limited to 'lib/multihandle.h')
-rw-r--r--lib/multihandle.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/multihandle.h b/lib/multihandle.h
index b65bd9638..a26fb619a 100644
--- a/lib/multihandle.h
+++ b/lib/multihandle.h
@@ -24,6 +24,7 @@
#include "conncache.h"
#include "psl.h"
+#include "socketpair.h"
struct Curl_message {
struct curl_llist_element list;
@@ -66,6 +67,10 @@ typedef enum {
#define CURLPIPE_ANY (CURLPIPE_MULTIPLEX)
+#if defined(USE_SOCKETPAIR) && !defined(USE_BLOCKING_SOCKETS)
+#define ENABLE_WAKEUP
+#endif
+
/* This is the struct known as CURLM on the outside */
struct Curl_multi {
/* First a simple identifier to easier detect if a user mix up
@@ -134,6 +139,11 @@ struct Curl_multi {
previous callback */
bool in_callback; /* true while executing a callback */
long max_concurrent_streams; /* max concurrent streams client to support */
+
+#ifdef ENABLE_WAKEUP
+ curl_socket_t wakeup_pair[2]; /* socketpair() used for wakeup
+ 0 is used for read, 1 is used for write */
+#endif
};
#endif /* HEADER_CURL_MULTIHANDLE_H */