[zypp-devel] [PATCH 1/2] Disable proxy only if _none_ is set in repo file
This patch set the Url "proxy" Param as "_none_" if user don't want to use proxy, and disable proxy only if user specified. Without this patch proxy always be disabled if repo file have no proxy info, and env proxy also can't be used. --- zypp/media/MediaCurl.cc | 7 +++---- zypp/parser/RepoFileReader.cc | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/zypp/media/MediaCurl.cc b/zypp/media/MediaCurl.cc index e6a8643..576ba3c 100644 --- a/zypp/media/MediaCurl.cc +++ b/zypp/media/MediaCurl.cc @@ -552,6 +552,9 @@ void MediaCurl::setupEasy() ZYPP_RETHROW(e); } + if ( _url.getQueryParam( "proxy" ) == "_none_" ) + SET_OPTION(CURLOPT_NOPROXY, "*"); + // if the proxy was not set by url, then look if ( _settings.proxy().empty() ) { @@ -643,10 +646,6 @@ void MediaCurl::setupEasy() SET_OPTION(CURLOPT_PROXYUSERPWD, proxyuserpwd.c_str()); } } - else - { - SET_OPTION(CURLOPT_NOPROXY, "*"); - } /** Speed limits */ if ( _settings.minDownloadSpeed() != 0 ) diff --git a/zypp/parser/RepoFileReader.cc b/zypp/parser/RepoFileReader.cc index eefacc5..f50f9f2 100644 --- a/zypp/parser/RepoFileReader.cc +++ b/zypp/parser/RepoFileReader.cc @@ -90,7 +90,8 @@ namespace zypp url.setQueryParam("proxy", what[1]); url.setQueryParam("proxyport", what[2]); } - } + } else + url.setQueryParam("proxy", "_none_"); } else ERR << "Unknown attribute in [" << *its << "]: " << it->second << " ignored" << endl; } -- 1.7.2.2 -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (1)
-
Zhang Qiang