From 499d5a095fd15d6065cbafd51d1012a2a05f4cf2 Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Wed, 14 May 2003 03:32:42 +0000 Subject: [PATCH] get_proxy() is using "http://" which fools get_proxies_by_url() into thinking the empty servername matches the unspecified (and empty) directhost (when no directhosts are specified) which messes up the proxy code. Fixed. --- panda/src/downloader/httpClient.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/panda/src/downloader/httpClient.cxx b/panda/src/downloader/httpClient.cxx index be910e0f74..3b6ff67ef2 100644 --- a/panda/src/downloader/httpClient.cxx +++ b/panda/src/downloader/httpClient.cxx @@ -449,11 +449,13 @@ get_proxies_for_url(const URLSpec &url, pvector &proxies) const { // First, check if the hostname matches any listed in direct_hosts. string hostname = url.get_server(); - DirectHosts::const_iterator si; - for (si = _direct_hosts.begin(); si != _direct_hosts.end(); ++si) { - if ((*si).matches(hostname)) { + if (!hostname.empty()) { // skip if hostname is just an empty 'http://' scheme + DirectHosts::const_iterator si; + for (si = _direct_hosts.begin(); si != _direct_hosts.end(); ++si) { + if ((*si).matches(hostname)) { // It matches, so don't use any proxies. - return; + return; + } } }