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

Unified Diff: net/proxy/proxy_config_service_linux.cc

Issue 10217008: Linux: Add support for new KDE space-delimited proxy port numbers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: merge Created 8 years, 8 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 133767)
+++ net/proxy/proxy_config_service_linux.cc (working copy)
@@ -1099,10 +1099,19 @@
if (value.empty() || value.substr(0, 3) == "//:")
// No proxy.
return;
- // We don't need to parse the port number out; GetProxyFromSettings()
- // would only append it right back again. So we just leave the port
- // number right in the host string.
- string_table_[host_key] = value;
+ size_t space = value.find(' ');
+ if (space != std::string::npos) {
+ // Newer versions of KDE use a space rather than a colon to separate the
+ // port number from the hostname. If we find this, we need to convert it.
+ std::string fixed = value;
+ fixed[space] = ':';
+ string_table_[host_key] = fixed;
+ } else {
+ // We don't need to parse the port number out; GetProxyFromSettings()
+ // would only append it right back again. So we just leave the port
+ // number right in the host string.
+ string_table_[host_key] = value;
+ }
}
void AddHostList(StringListSetting key, const std::string& value) {
« 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