From: Daniel Stenberg Date: Thu, 4 Aug 2011 22:44:40 +0000 (+0200) Subject: create_conn: mark non-HTTP proxies accordingly X-Git-Tag: upstream/7.37.1~3890 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=17f343290c9888ab5f108b0e4c8f6510cff47959;p=platform%2Fupstream%2Fcurl.git create_conn: mark non-HTTP proxies accordingly A proxy could be marked 'httpproxy' wrongly before if set with an environment variable or with the CURLOPT_PROXY option with a socks*:// prefix or similar. Added test 710 to verify Bug: http://curl.haxx.se/mail/lib-2011-07/0194.html --- diff --git a/lib/url.c b/lib/url.c index a3a475d..400ceff 100644 --- a/lib/url.c +++ b/lib/url.c @@ -3501,6 +3501,8 @@ static struct connectdata *allocate_conn(struct SessionHandle *data) #else /* CURL_DISABLE_PROXY */ + /* note that these two proxy bits are now just on what looks to be + requested, they may be altered down the road */ conn->bits.proxy = (bool)(data->set.str[STRING_PROXY] && *data->set.str[STRING_PROXY]); conn->bits.httpproxy = (bool)(conn->bits.proxy && @@ -4825,6 +4827,8 @@ static CURLcode create_conn(struct SessionHandle *data, conn->bits.httpproxy = TRUE; #endif } + else + conn->bits.httpproxy = FALSE; /* not a HTTP proxy */ conn->bits.proxy = TRUE; } else {