[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 58/282: conn: do not reuse connection if SOCKS proxy credentials
From: |
gnunet |
Subject: |
[gnurl] 58/282: conn: do not reuse connection if SOCKS proxy credentials differ |
Date: |
Wed, 01 Apr 2020 14:28:43 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 34e6bc42b0650c48504a286020dcda85180e05e2
Author: Peter Piekarski <address@hidden>
AuthorDate: Mon Jan 20 18:02:09 2020 +0100
conn: do not reuse connection if SOCKS proxy credentials differ
Closes #4835
---
lib/url.c | 33 +++++++++++++++++++++++++++++++--
1 file changed, 31 insertions(+), 2 deletions(-)
diff --git a/lib/url.c b/lib/url.c
index d73eede16..689668e04 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -882,9 +882,37 @@ proxy_info_matches(const struct proxy_info* data,
return FALSE;
}
+
+static bool
+socks_proxy_info_matches(const struct proxy_info* data,
+ const struct proxy_info* needle)
+{
+ if(!proxy_info_matches(data, needle))
+ return FALSE;
+
+ /* the user information is case-sensitive
+ or at least it is not defined as case-insensitive
+ see https://tools.ietf.org/html/rfc3986#section-3.2.1 */
+ if((data->user == NULL) != (needle->user == NULL))
+ return FALSE;
+ /* curl_strequal does a case insentive comparison, so do not use it here! */
+ if(data->user &&
+ needle->user &&
+ strcmp(data->user, needle->user) != 0)
+ return FALSE;
+ if((data->passwd == NULL) != (needle->passwd == NULL))
+ return FALSE;
+ /* curl_strequal does a case insentive comparison, so do not use it here! */
+ if(data->passwd &&
+ needle->passwd &&
+ strcmp(data->passwd, needle->passwd) != 0)
+ return FALSE;
+ return TRUE;
+}
#else
/* disabled, won't get called */
#define proxy_info_matches(x,y) FALSE
+#define socks_proxy_info_matches(x,y) FALSE
#endif
/* A connection has to have been idle for a shorter time than 'maxage_conn' to
@@ -1143,8 +1171,9 @@ ConnectionExists(struct Curl_easy *data,
needle->bits.socksproxy != check->bits.socksproxy)
continue;
- if(needle->bits.socksproxy && !proxy_info_matches(&needle->socks_proxy,
- &check->socks_proxy))
+ if(needle->bits.socksproxy &&
+ !socks_proxy_info_matches(&needle->socks_proxy,
+ &check->socks_proxy))
continue;
if(needle->bits.conn_to_host != check->bits.conn_to_host)
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 46/282: copyright: fix year ranges, (continued)
- [gnurl] 46/282: copyright: fix year ranges, gnunet, 2020/04/01
- [gnurl] 34/282: curl:progressbarinit: ignore column width from terminals < 20, gnunet, 2020/04/01
- [gnurl] 29/282: HTTP-COOKIES.md: describe the cookie file format, gnunet, 2020/04/01
- [gnurl] 51/282: openssl: make CURLINFO_CERTINFO not truncate x509v3 fields, gnunet, 2020/04/01
- [gnurl] 60/282: curl: make the -# spaceship bar not wrap the line, gnunet, 2020/04/01
- [gnurl] 50/282: CURLOPT_PROXY_SSL_OPTIONS.3: Sync with CURLOPT_SSL_OPTIONS.3, gnunet, 2020/04/01
- [gnurl] 61/282: urldata: do string enums without #ifdefs for build scripts, gnunet, 2020/04/01
- [gnurl] 47/282: smtp: Allow RCPT TO command to fail for some recipients, gnunet, 2020/04/01
- [gnurl] 62/282: RELEASE-NOTES: synced, gnunet, 2020/04/01
- [gnurl] 48/282: RELEASE-NOTES: synced, gnunet, 2020/04/01
- [gnurl] 58/282: conn: do not reuse connection if SOCKS proxy credentials differ,
gnunet <=
- [gnurl] 37/282: wolfssl: use the wc-prefixed symbol alternatives, gnunet, 2020/04/01
- [gnurl] 28/282: CMake: Add support for CMAKE_LTO option., gnunet, 2020/04/01
- [gnurl] 38/282: RELEASE-NOTES: synced, gnunet, 2020/04/01
- [gnurl] 44/282: curl: Let -D merge headers in one file again, gnunet, 2020/04/01
- [gnurl] 41/282: http.h: Copyright year out of date, should be 2020, gnunet, 2020/04/01
- [gnurl] 52/282: form.d: fix two minor typos, gnunet, 2020/04/01
- [gnurl] 64/282: README: mention that the docs is in docs/, gnunet, 2020/04/01
- [gnurl] 53/282: wolfssh: make it init properly via Curl_ssh_init(), gnunet, 2020/04/01
- [gnurl] 56/282: conncache: removed unused Curl_conncache_bundle_size(), gnunet, 2020/04/01
- [gnurl] 54/282: singleuse.pl: support new API functions, fix curl_dbg_ handling, gnunet, 2020/04/01