]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
socketpair: allow CURL_DISABLE_SOCKETPAIR
authorDaniel Stenberg <daniel@haxx.se>
Fri, 14 Aug 2020 13:45:08 +0000 (15:45 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 26 Aug 2020 20:58:21 +0000 (22:58 +0200)
... to completely disable the use of socketpair

Closes #5850

configure.ac
docs/CURL-DISABLE.md
lib/multihandle.h
lib/socketpair.c

index 918003e024ee76f8e6906af49db387433d5404ce..0d3e4e1038c4a2e5cfaa93c70c7ee5b7d47525f2 100755 (executable)
@@ -4686,6 +4686,24 @@ AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
        AC_MSG_RESULT(yes)
 )
 
+dnl ************************************************************
+dnl disable socketpair
+dnl
+AC_MSG_CHECKING([whether to support socketpair])
+AC_ARG_ENABLE(socketpair,
+AC_HELP_STRING([--enable-socketpair],[Enable socketpair support])
+AC_HELP_STRING([--disable-socketpair],[Disable socketpair support]),
+[ case "$enableval" in
+  no)
+       AC_MSG_RESULT(no)
+       AC_DEFINE(CURL_DISABLE_SOCKETPAIR, 1, [to disable socketpair support])
+       ;;
+  *)   AC_MSG_RESULT(yes)
+       ;;
+  esac ],
+       AC_MSG_RESULT(yes)
+)
+
 dnl ************************************************************
 dnl disable HTTP authentication support
 dnl
index 83436b473d20524842da85c37a34cb9cb29ee155..2dd250c7ff793115ad51bac545df4b421564f954 100644 (file)
@@ -97,6 +97,11 @@ Disable the SMB(S) protocols
 
 Disable the SMTP(S) protocols
 
+## CURL_DISABLE_SOCKETPAIR
+
+Disable the use of socketpair internally to allow waking up and canceling
+curl_multi_poll().
+
 ## CURL_DISABLE_TELNET
 
 Disable the TELNET protocol
index 0c9ce7f74ebb62f8c3ba5e163ad62fd8314a7679..46eb12146e69c4a21ee02857c279c64e1872208d 100644 (file)
@@ -67,11 +67,11 @@ typedef enum {
 
 #define CURLPIPE_ANY (CURLPIPE_MULTIPLEX)
 
-#if defined(USE_SOCKETPAIR) && !defined(USE_BLOCKING_SOCKETS)
+#if defined(USE_SOCKETPAIR) && !defined(USE_BLOCKING_SOCKETS) &&        \
+  !defined(CURL_DISABLE_SOCKETPAIR)
 #define ENABLE_WAKEUP
 #endif
 
-
 /* value for MAXIMUM CONCURRENT STREAMS upper limit */
 #define INITIAL_MAX_CONCURRENT_STREAMS ((1U << 31) - 1)
 
index 1ec0d75a468c384f801a614d91fe18d6e5c6fec1..9e1f9ef4c1d6bab9db574627f6b42fcd87e12b14 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 2019 - 2020, 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
@@ -23,7 +23,7 @@
 #include "curl_setup.h"
 #include "socketpair.h"
 
-#ifndef HAVE_SOCKETPAIR
+#if !defined(HAVE_SOCKETPAIR) && !defined(CURL_DISABLE_SOCKETPAIR)
 #ifdef WIN32
 /*
  * This is a socketpair() implementation for Windows.