#define TRANSFER_TIMEOUT 60 * 3
#define TRANSFER_TIMEOUT_MAX 60 * 60
+#define EXPLICITLY_NO_PROXY "_none_"
+
#undef CURLVERSION_AT_LEAST
#define CURLVERSION_AT_LEAST(M,N,O) LIBCURL_VERSION_NUM >= ((((M)<<8)+(N))<<8)+(O)
param = url.getQueryParam( "proxy" );
if ( ! param.empty() )
{
- if ( param == "_none_" ) {
+ if ( param == EXPLICITLY_NO_PROXY ) {
// Workaround TransferSettings shortcoming: With an
// empty proxy string, code will continue to look for
// valid proxy settings. So set proxy to some non-empty
// string, to indicate it has been explicitly disabled.
- s.setProxy("_none_");
+ s.setProxy(EXPLICITLY_NO_PROXY);
s.setProxyEnabled(false);
}
else {
SET_OPTION(CURLOPT_PROXYUSERPWD, unEscape( proxyuserpwd ).c_str());
}
}
- else
- {
- DBG << "Proxy: NOPROXY" << endl;
#if CURLVERSION_AT_LEAST(7,19,4)
- SET_OPTION(CURLOPT_NOPROXY, "*");
+ else if ( _settings.proxy() == EXPLICITLY_NO_PROXY )
+ {
+ // Explicitly disabled in URL (see fillSettingsFromUrl()).
+ // This should also prevent libcurl from looking into the environment.
+ DBG << "Proxy: explicitly NOPROXY" << endl;
+ SET_OPTION(CURLOPT_NOPROXY, "*");
+ }
#endif
+ else
+ {
+ // libcurl may look into the enviroanment
+ DBG << "Proxy: not explicitly set" << endl;
}
/** Speed limits */
* Turn off using cookies by setting it to "0" (or false, no, off).
* - <tt>proxy</tt>:
* A proxy hostname or hostname and port separated by ':'.
+ * Setting the hostname to '_none_' explicitly disables the use of a
+ * proxy even if configured in /etc/sysconfig/proxy or the environment.
* - <tt>proxyport</tt>:
* Alternative way to provide the proxy port.
* - <tt>proxyuser</tt>: