ref: refs/heads/ma-misc
commit 7495249368eca3973ddf7d658d415bf4a0d3857e
Author: Michael Andres
Date: Thu Oct 1 12:12:17 2009 +0200
Fix evaluation of no_proxy entries (bnc #543337)
---
zypp/media/MediaCurl.cc | 43 +++----------------------------------------
1 files changed, 3 insertions(+), 40 deletions(-)
diff --git a/zypp/media/MediaCurl.cc b/zypp/media/MediaCurl.cc
index b54ffd4..229f01f 100644
--- a/zypp/media/MediaCurl.cc
+++ b/zypp/media/MediaCurl.cc
@@ -301,46 +301,9 @@ void fillSettingsFromUrl( const Url &url, TransferSettings &s )
void fillSettingsSystemProxy( const Url&url, TransferSettings &s )
{
ProxyInfo proxy_info (ProxyInfo::ImplPtr(new ProxyInfoSysconfig("proxy")));
-
- if ( proxy_info.enabled())
- {
- s.setProxyEnabled(true);
- std::liststd::string nope = proxy_info.noProxy();
- for (ProxyInfo::NoProxyIterator it = proxy_info.noProxyBegin();
- it != proxy_info.noProxyEnd();
- it++)
- {
- std::string host( str::toLower(url.getHost()));
- std::string temp( str::toLower(*it));
-
- // no proxy if it points to a suffix
- // preceeded by a '.', that maches
- // the trailing portion of the host.
- if( temp.size() > 1 && temp.at(0) == '.')
- {
- if(host.size() > temp.size() &&
- host.compare(host.size() - temp.size(), temp.size(), temp) == 0)
- {
- DBG << "NO_PROXY: '" << *it << "' matches host '"
- << host << "'" << endl;
- s.setProxyEnabled(false);
- break;
- }
- }
- else
- // no proxy if we have an exact match
- if( host == temp)
- {
- DBG << "NO_PROXY: '" << *it << "' matches host '"
- << host << "'" << endl;
- s.setProxyEnabled(false);
- break;
- }
- }
-
- if ( s.proxyEnabled() )
- s.setProxy(proxy_info.proxy(url.getScheme()));
- }
+ s.setProxyEnabled( proxy_info.useProxyFor( url ) );
+ if ( s.proxyEnabled() )
+ s.setProxy(proxy_info.proxy(url.getScheme()));
}
Pathname MediaCurl::_cookieFile = "/var/lib/YaST2/cookies";
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org