[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 24/63: tool_setopt: for builds with disabled-proxy,
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 24/63: tool_setopt: for builds with disabled-proxy, skip all proxy setopts() |
Date: |
Fri, 07 Jun 2019 18:36:46 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 4e86f2fc4e6c504c39baf5763f34225c41c1605b
Author: Daniel Stenberg <address@hidden>
AuthorDate: Wed May 22 23:25:43 2019 +0200
tool_setopt: for builds with disabled-proxy, skip all proxy setopts()
Reported-by: Marcel Raad
Fixes #3926
Closes #3929
---
src/tool_setopt.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
src/tool_setopt.h | 41 ++++++++++++++++++++++-------------------
2 files changed, 74 insertions(+), 19 deletions(-)
diff --git a/src/tool_setopt.c b/src/tool_setopt.c
index 745b4546e..ff67c22e7 100644
--- a/src/tool_setopt.c
+++ b/src/tool_setopt.c
@@ -713,4 +713,56 @@ CURLcode tool_setopt(CURL *curl, bool str, struct
GlobalConfig *config,
return ret;
}
+#else /* CURL_DISABLE_LIBCURL_OPTION */
+
+#include "tool_cfgable.h"
+#include "tool_setopt.h"
+
#endif /* CURL_DISABLE_LIBCURL_OPTION */
+
+CURLcode tool_real_error(CURLcode result, CURLoption tag)
+{
+#ifdef CURL_DISABLE_PROXY
+ switch(tag) {
+ case CURLOPT_HAPROXYPROTOCOL:
+ case CURLOPT_HTTPPROXYTUNNEL:
+ case CURLOPT_NOPROXY:
+ case CURLOPT_PRE_PROXY:
+ case CURLOPT_PROXY:
+ case CURLOPT_PROXYAUTH:
+ case CURLOPT_PROXY_CAINFO:
+ case CURLOPT_PROXY_CAPATH:
+ case CURLOPT_PROXY_CRLFILE:
+ case CURLOPT_PROXYHEADER:
+ case CURLOPT_PROXY_KEYPASSWD:
+ case CURLOPT_PROXYPASSWORD:
+ case CURLOPT_PROXY_PINNEDPUBLICKEY:
+ case CURLOPT_PROXYPORT:
+ case CURLOPT_PROXY_SERVICE_NAME:
+ case CURLOPT_PROXY_SSLCERT:
+ case CURLOPT_PROXY_SSLCERTTYPE:
+ case CURLOPT_PROXY_SSL_CIPHER_LIST:
+ case CURLOPT_PROXY_SSLKEY:
+ case CURLOPT_PROXY_SSLKEYTYPE:
+ case CURLOPT_PROXY_SSL_OPTIONS:
+ case CURLOPT_PROXY_SSL_VERIFYHOST:
+ case CURLOPT_PROXY_SSL_VERIFYPEER:
+ case CURLOPT_PROXY_SSLVERSION:
+ case CURLOPT_PROXY_TLS13_CIPHERS:
+ case CURLOPT_PROXY_TLSAUTH_PASSWORD:
+ case CURLOPT_PROXY_TLSAUTH_TYPE:
+ case CURLOPT_PROXY_TLSAUTH_USERNAME:
+ case CURLOPT_PROXY_TRANSFER_MODE:
+ case CURLOPT_PROXYTYPE:
+ case CURLOPT_PROXYUSERNAME:
+ case CURLOPT_PROXYUSERPWD:
+ return CURLE_OK; /* pretend it worked */
+ default:
+ break;
+ }
+#else
+ (void)tag;
+#endif
+ return result;
+}
+
diff --git a/src/tool_setopt.h b/src/tool_setopt.h
index 663041f65..2266d1c9c 100644
--- a/src/tool_setopt.h
+++ b/src/tool_setopt.h
@@ -29,11 +29,14 @@
* Macros used in operate()
*/
-#define SETOPT_CHECK(v) do { \
- result = (v); \
- if(result) \
- goto show_error; \
-} WHILE_FALSE
+#define SETOPT_CHECK(v,opt) do { \
+ result = tool_real_error((v), opt); \
+ if(result) \
+ goto show_error; \
+ } WHILE_FALSE
+
+/* allow removed features to simulate success: */
+CURLcode tool_real_error(CURLcode result, CURLoption tag);
#ifndef CURL_DISABLE_LIBCURL_OPTION
@@ -97,25 +100,25 @@ CURLcode tool_setopt(CURL *curl, bool str, struct
GlobalConfig *config,
const char *name, CURLoption tag, ...);
#define my_setopt(x,y,z) \
- SETOPT_CHECK(tool_setopt(x, FALSE, global, #y, y, z))
+ SETOPT_CHECK(tool_setopt(x, FALSE, global, #y, y, z), y)
#define my_setopt_str(x,y,z) \
- SETOPT_CHECK(tool_setopt(x, TRUE, global, #y, y, z))
+ SETOPT_CHECK(tool_setopt(x, TRUE, global, #y, y, z), y)
#define my_setopt_enum(x,y,z) \
- SETOPT_CHECK(tool_setopt_enum(x, global, #y, y, setopt_nv_ ## y, z))
+ SETOPT_CHECK(tool_setopt_enum(x, global, #y, y, setopt_nv_ ## y, z), y)
#define my_setopt_flags(x,y,z) \
- SETOPT_CHECK(tool_setopt_flags(x, global, #y, y, setopt_nv_ ## y, z))
+ SETOPT_CHECK(tool_setopt_flags(x, global, #y, y, setopt_nv_ ## y, z), y)
#define my_setopt_bitmask(x,y,z) \
- SETOPT_CHECK(tool_setopt_bitmask(x, global, #y, y, setopt_nv_ ## y, z))
+ SETOPT_CHECK(tool_setopt_bitmask(x, global, #y, y, setopt_nv_ ## y, z), y)
#define my_setopt_mimepost(x,y,z) \
- SETOPT_CHECK(tool_setopt_mimepost(x, global, #y, y, z))
+ SETOPT_CHECK(tool_setopt_mimepost(x, global, #y, y, z), y)
#define my_setopt_slist(x,y,z) \
- SETOPT_CHECK(tool_setopt_slist(x, global, #y, y, z))
+ SETOPT_CHECK(tool_setopt_slist(x, global, #y, y, z), y)
#define res_setopt(x,y,z) tool_setopt(x, FALSE, global, #y, y, z)
@@ -126,25 +129,25 @@ CURLcode tool_setopt(CURL *curl, bool str, struct
GlobalConfig *config,
/* No --libcurl, so pass options directly to library */
#define my_setopt(x,y,z) \
- SETOPT_CHECK(curl_easy_setopt(x, y, z))
+ SETOPT_CHECK(curl_easy_setopt(x, y, z), y)
#define my_setopt_str(x,y,z) \
- SETOPT_CHECK(curl_easy_setopt(x, y, z))
+ SETOPT_CHECK(curl_easy_setopt(x, y, z), y)
#define my_setopt_enum(x,y,z) \
- SETOPT_CHECK(curl_easy_setopt(x, y, z))
+ SETOPT_CHECK(curl_easy_setopt(x, y, z), y)
#define my_setopt_flags(x,y,z) \
- SETOPT_CHECK(curl_easy_setopt(x, y, z))
+ SETOPT_CHECK(curl_easy_setopt(x, y, z), y)
#define my_setopt_bitmask(x,y,z) \
- SETOPT_CHECK(curl_easy_setopt(x, y, z))
+ SETOPT_CHECK(curl_easy_setopt(x, y, z), y)
#define my_setopt_mimepost(x,y,z) \
- SETOPT_CHECK(curl_easy_setopt(x, y, z))
+ SETOPT_CHECK(curl_easy_setopt(x, y, z), y)
#define my_setopt_slist(x,y,z) \
- SETOPT_CHECK(curl_easy_setopt(x, y, z))
+ SETOPT_CHECK(curl_easy_setopt(x, y, z), y)
#define res_setopt(x,y,z) curl_easy_setopt(x,y,z)
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [gnurl] 27/63: RELEASE-NOTES: synced, (continued)
- [GNUnet-SVN] [gnurl] 27/63: RELEASE-NOTES: synced, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 45/63: conncache: Remove the DEBUGASSERT on length check, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 33/63: HAProxy tests: add keywords, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 32/63: tests: make test 1420 and 1406 work with rtsp-disabled libcurl, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 51/63: http: don't parse body-related headers bodyless responses, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 53/63: NTLM: reset proxy "multipass" state when CONNECT request is done, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 58/63: curl_share_setopt.3: improve wording [ci ship], gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 56/63: TODO: "at least N milliseconds between requests" [ci skip], gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 46/63: http2: Stop drain from being permanently set on, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 19/63: os400: take care of CURLOPT_SASL_AUTHZID in curl_easy_setopt_ccsid()., gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 24/63: tool_setopt: for builds with disabled-proxy, skip all proxy setopts(),
gnunet <=
- [GNUnet-SVN] [gnurl] 18/63: .github/FUNDING: mention our opencollective "home" [ci skip], gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 20/63: md4: build correctly with openssl without MD4, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 16/63: tests: Fix the line endings for the SASL alt-auth tests, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 06/63: examples: remove dead variable stores, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 26/63: sectransp: handle errSSLPeerAuthCompleted from SSLRead(), gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 38/63: url: default conn->port to the same as conn->remote_port, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 31/63: nss: allow to specify TLS 1.3 ciphers if supported by NSS, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 36/63: multi: track users of a socket better, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 28/63: FAQ: more minor updates and spelling fixes, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 34/63: cmake: support CMAKE_OSX_ARCHITECTURES when detecting SIZEOF variables, gnunet, 2019/06/07