Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2354)

Unified Diff: net/proxy/proxy_config_service_linux.cc

Issue 3413037: Change the default SOCKS version used by gnome settings (and environment vari... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/proxy/proxy_config_service_linux_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_config_service_linux.cc
===================================================================
--- net/proxy/proxy_config_service_linux.cc (revision 60502)
+++ net/proxy/proxy_config_service_linux.cc (working copy)
@@ -43,11 +43,11 @@
// TODO(arindam): Remove URI string manipulation by using MapUrlSchemeToProxy.
std::string FixupProxyHostScheme(ProxyServer::Scheme scheme,
std::string host) {
- if (scheme == ProxyServer::SCHEME_SOCKS4 &&
- StartsWithASCII(host, "socks5://", false)) {
- // We default to socks 4, but if the user specifically set it to
- // socks5://, then use that.
- scheme = ProxyServer::SCHEME_SOCKS5;
+ if (scheme == ProxyServer::SCHEME_SOCKS5 &&
+ StartsWithASCII(host, "socks4://", false)) {
+ // We default to socks 5, but if the user specifically set it to
+ // socks4://, then use that.
+ scheme = ProxyServer::SCHEME_SOCKS4;
}
// Strip the scheme if any.
std::string::size_type colon = host.find("://");
@@ -152,11 +152,13 @@
}
if (config->proxy_rules().empty()) {
// If the above were not defined, try for socks.
- ProxyServer::Scheme scheme = ProxyServer::SCHEME_SOCKS4;
+ // For environment variables, we default to version 5, per the gnome
+ // documentation: http://library.gnome.org/devel/gnet/stable/gnet-socks.html
+ ProxyServer::Scheme scheme = ProxyServer::SCHEME_SOCKS5;
std::string env_version;
if (env_var_getter_->GetVar("SOCKS_VERSION", &env_version)
- && env_version == "5")
- scheme = ProxyServer::SCHEME_SOCKS5;
+ && env_version == "4")
+ scheme = ProxyServer::SCHEME_SOCKS4;
if (GetProxyFromEnvVarForScheme("SOCKS_SERVER", scheme, &proxy_server)) {
config->proxy_rules().type = ProxyConfig::ProxyRules::TYPE_SINGLE_PROXY;
config->proxy_rules().single_proxy = proxy_server;
@@ -915,7 +917,7 @@
host += ":" + base::IntToString(port);
}
host = FixupProxyHostScheme(
- is_socks ? ProxyServer::SCHEME_SOCKS4 : ProxyServer::SCHEME_HTTP,
+ is_socks ? ProxyServer::SCHEME_SOCKS5 : ProxyServer::SCHEME_HTTP,
host);
ProxyServer proxy_server = ProxyServer::FromURI(host,
ProxyServer::SCHEME_HTTP);
@@ -982,7 +984,9 @@
// Try socks.
if (GetProxyFromGConf("/system/proxy/socks_", true, &proxy_server)) {
// gconf settings do not appear to distinguish between socks
- // version. We default to version 4.
+ // version. We default to version 5. For more information on this policy
+ // decisions, see:
+ // http://code.google.com/p/chromium/issues/detail?id=55912#c2
config->proxy_rules().type = ProxyConfig::ProxyRules::TYPE_SINGLE_PROXY;
config->proxy_rules().single_proxy = proxy_server;
}
« no previous file with comments | « no previous file | net/proxy/proxy_config_service_linux_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698