summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Kaufmann <mail@michael-kaufmann.ch>2017-09-24 15:21:44 +0200
committerMichael Kaufmann <mail@michael-kaufmann.ch>2017-10-03 18:04:42 +0200
commitc4ebd8b46de09d45e251bed7e9bfc2a0ddf21d98 (patch)
tree8c1a960179955f17b35436f756d5b3a77b3e96f4 /lib
parentff6774ea6a03ae193f92e7175e9b96aaffb3f44c (diff)
downloadcurl-c4ebd8b46de09d45e251bed7e9bfc2a0ddf21d98.tar.gz
proxy: read the "no_proxy" variable only if necessary
Reviewed-by: Daniel Stenberg Closes #1919
Diffstat (limited to 'lib')
-rw-r--r--lib/url.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/url.c b/lib/url.c
index df12cbf6d..132dbb432 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -5352,22 +5352,21 @@ static CURLcode create_conn_helper_init_proxy(struct connectdata *conn)
}
}
- no_proxy = curl_getenv("no_proxy");
- if(!no_proxy)
- no_proxy = curl_getenv("NO_PROXY");
+ if(!data->set.str[STRING_NOPROXY]) {
+ no_proxy = curl_getenv("no_proxy");
+ if(!no_proxy)
+ no_proxy = curl_getenv("NO_PROXY");
+ }
- if(check_noproxy(conn->host.name, data->set.str[STRING_NOPROXY]) ||
- (!data->set.str[STRING_NOPROXY] &&
- check_noproxy(conn->host.name, no_proxy))) {
+ if(check_noproxy(conn->host.name, data->set.str[STRING_NOPROXY] ?
+ data->set.str[STRING_NOPROXY] : no_proxy)) {
Curl_safefree(proxy);
Curl_safefree(socksproxy);
}
- else if(!proxy && !socksproxy)
#ifndef CURL_DISABLE_HTTP
+ else if(!proxy && !socksproxy)
/* if the host is not in the noproxy list, detect proxy. */
proxy = detect_proxy(conn);
-#else /* !CURL_DISABLE_HTTP */
- proxy = NULL;
#endif /* CURL_DISABLE_HTTP */
Curl_safefree(no_proxy);