From 2642638fcae2c51a3407f0af6a90b3c6aca895f5 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 1 Aug 2009 11:02:10 +0000 Subject: - Alexander Beedie provided the patch for a noproxy problem: If I have set CURLOPT_NOPROXY to "*", or to a host that should not use a proxy, I actually could still end up using a proxy if a proxy environment variable was set. --- lib/url.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/url.c') diff --git a/lib/url.c b/lib/url.c index 5f209fe5e..96db7e481 100644 --- a/lib/url.c +++ b/lib/url.c @@ -4419,14 +4419,17 @@ static CURLcode create_conn(struct SessionHandle *data, } } - if(!proxy) - proxy = detect_proxy(conn); - else if(data->set.str[STRING_NOPROXY]) { - if(check_noproxy(conn->host.name, data->set.str[STRING_NOPROXY])) { + + if(data->set.str[STRING_NOPROXY] && + check_noproxy(conn->host.name, data->set.str[STRING_NOPROXY])) { + if(proxy) { free(proxy); /* proxy is in exception list */ proxy = NULL; } } + else if(!proxy) + proxy = detect_proxy(conn); + if(proxy && !*proxy) { free(proxy); /* Don't bother with an empty proxy string */ proxy = NULL; -- cgit v1.2.3