string proxy = url.getQueryParam( "proxy" );
if ( ! proxy.empty() )
{
- string proxyport( url.getQueryParam( "proxyport" ) );
- if ( ! proxyport.empty() ) {
- proxy += ":" + proxyport;
+ if ( proxy == "_none_" ) {
+ s.setProxyEnabled(false);
}
- s.setProxy(proxy);
- s.setProxyEnabled(true);
+ else {
+ string proxyport( url.getQueryParam( "proxyport" ) );
+ if ( ! proxyport.empty() ) {
+ proxy += ":" + proxyport;
+ }
+ s.setProxy(proxy);
+ s.setProxyEnabled(true);
+ }
}
// HTTP authentication type
SET_OPTION(CURLOPT_PROXYUSERPWD, proxyuserpwd.c_str());
}
}
-
+ else
+ {
+ SET_OPTION(CURLOPT_NOPROXY, "*");
+ }
+
/** Speed limits */
if ( _settings.minDownloadSpeed() != 0 )
{
#include <iostream>
#include "zypp/base/Logger.h"
#include "zypp/base/String.h"
+#include "zypp/base/Regex.h"
#include "zypp/base/InputStream.h"
#include "zypp/base/UserRequestException.h"
{
RepoInfo info;
info.setAlias(*its);
+ Url url;
for ( IniDict::entry_const_iterator it = dict.entriesBegin(*its);
it != dict.entriesEnd(*its);
else if ( it->first == "priority" )
info.setPriority( str::strtonum<unsigned>( it->second ) );
else if ( it->first == "baseurl" && !it->second.empty())
- info.addBaseUrl( Url(it->second) );
+ url = it->second;
else if ( it->first == "path" )
info.setPath( Pathname(it->second) );
else if ( it->first == "type" )
info.setKeepPackages( str::strToTrue( it->second ) );
else if ( it->first == "service" )
info.setService( it->second );
- else
+ else if ( it->first == "proxy" )
+ {
+ if (it->second != "_none_" )
+ {
+ str::regex ex("^(.*):([0-9]+)$");
+ str::smatch what;
+ if(str::regex_match(it->second, what, ex)){
+ url.setQueryParam("proxy", what[1]);
+ url.setQueryParam("proxyport", what[2]);
+ }
+ }
+ } else
ERR << "Unknown attribute in [" << *its << "]: " << it->second << " ignored" << endl;
}
- info.setFilepath(file);
+ if (url.isValid())
+ info.addBaseUrl(url);
+
+ info.setFilepath(is.path());
MIL << info << endl;
// add it to the list.
callback(info);