1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

socketpair: allow CURL_DISABLE_SOCKETPAIR

... to completely disable the use of socketpair

Closes #5850
This commit is contained in:
Daniel Stenberg 2020-08-14 15:45:08 +02:00
parent ce88e21c72
commit d854572ccc
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
4 changed files with 27 additions and 4 deletions

View File

@ -4686,6 +4686,24 @@ AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
AC_MSG_RESULT(yes) 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 ************************************************************
dnl disable HTTP authentication support dnl disable HTTP authentication support
dnl dnl

View File

@ -97,6 +97,11 @@ Disable the SMB(S) protocols
Disable the SMTP(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 ## CURL_DISABLE_TELNET
Disable the TELNET protocol Disable the TELNET protocol

View File

@ -67,11 +67,11 @@ typedef enum {
#define CURLPIPE_ANY (CURLPIPE_MULTIPLEX) #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 #define ENABLE_WAKEUP
#endif #endif
/* value for MAXIMUM CONCURRENT STREAMS upper limit */ /* value for MAXIMUM CONCURRENT STREAMS upper limit */
#define INITIAL_MAX_CONCURRENT_STREAMS ((1U << 31) - 1) #define INITIAL_MAX_CONCURRENT_STREAMS ((1U << 31) - 1)

View 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 * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -23,7 +23,7 @@
#include "curl_setup.h" #include "curl_setup.h"
#include "socketpair.h" #include "socketpair.h"
#ifndef HAVE_SOCKETPAIR #if !defined(HAVE_SOCKETPAIR) && !defined(CURL_DISABLE_SOCKETPAIR)
#ifdef WIN32 #ifdef WIN32
/* /*
* This is a socketpair() implementation for Windows. * This is a socketpair() implementation for Windows.