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

Issue 149191: Whenever proxy configurations contain socks and http/https/ftp proxies, socks... (Closed)

Created:
11 years, 5 months ago by Arindam
Modified:
9 years, 7 months ago
Reviewers:
eroman
CC:
chromium-reviews_googlegroups.com, darin (slow to review), willchan no longer on Chromium
Visibility:
Public.

Description

Whenever proxy configurations contain socks and http/https/ftp proxies, socks configuration over rid the other proxies. Fixes the issue. Attached test cases. BUG=15738 TEST=unittest (ProxyConfigTest.ParseProxyRules, ProxyServiceTest.DefaultProxyFallbackToSOCKS) Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=20605

Patch Set 1 #

Total comments: 2

Patch Set 2 : '' #

Total comments: 9

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 22

Patch Set 5 : fixed nits #

Patch Set 6 : adding disabled win test #

Total comments: 15

Patch Set 7 : newtest #

Total comments: 4

Patch Set 8 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+211 lines, -55 lines) Patch
M net/proxy/proxy_config.h View 3 4 5 6 7 2 chunks +16 lines, -5 lines 0 comments Download
M net/proxy/proxy_config.cc View 1 2 3 4 5 6 7 4 chunks +25 lines, -17 lines 0 comments Download
M net/proxy/proxy_config_service_common_unittest.h View 3 4 5 6 7 2 chunks +8 lines, -1 line 0 comments Download
M net/proxy/proxy_config_service_common_unittest.cc View 3 4 5 6 7 2 chunks +22 lines, -7 lines 0 comments Download
M net/proxy/proxy_config_service_linux.cc View 4 5 6 7 3 chunks +5 lines, -2 lines 0 comments Download
M net/proxy/proxy_config_service_win_unittest.cc View 6 7 1 chunk +19 lines, -0 lines 0 comments Download
M net/proxy/proxy_config_unittest.cc View 1 2 3 4 5 6 7 10 chunks +46 lines, -7 lines 0 comments Download
M net/proxy/proxy_list.cc View 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M net/proxy/proxy_server.h View 3 4 5 6 7 1 chunk +6 lines, -5 lines 0 comments Download
M net/proxy/proxy_server.cc View 3 4 5 6 7 1 chunk +7 lines, -5 lines 0 comments Download
M net/proxy/proxy_server_unittest.cc View 3 4 5 6 7 4 chunks +9 lines, -4 lines 0 comments Download
M net/proxy/proxy_service.cc View 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M net/proxy/proxy_service_unittest.cc View 3 4 5 6 7 1 chunk +46 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Arindam
http://codereview.chromium.org/149191/diff/1/3 File net/proxy/proxy_config.cc (right): http://codereview.chromium.org/149191/diff/1/3#newcode67 Line 67: proxy_server_token.insert(0, "socks://"); I append socks:// to make it ...
11 years, 5 months ago (2009-07-06 03:40:33 UTC) #1
eroman
Note that there is still a problem in ProxyService::ApplyProxyRules(). In particular check out this clause: ...
11 years, 5 months ago (2009-07-06 23:32:48 UTC) #2
Arindam
Added test to verify SOCKS fallback http://codereview.chromium.org/149191/diff/1005/1007 File net/proxy/proxy_config.cc (right): http://codereview.chromium.org/149191/diff/1005/1007#newcode67 Line 67: proxy_server_token.find("://") == ...
11 years, 5 months ago (2009-07-08 05:45:56 UTC) #3
eroman
LGTM! thanks for doing the larger change (adding the extra parameter to FromURI). http://codereview.chromium.org/149191/diff/1005/1007 File ...
11 years, 5 months ago (2009-07-08 07:18:42 UTC) #4
Arindam
http://codereview.chromium.org/149191/diff/1005/1007 File net/proxy/proxy_config.cc (right): http://codereview.chromium.org/149191/diff/1005/1007#newcode98 Line 98: return &single_proxy; On 2009/07/08 07:18:42, eroman wrote: > ...
11 years, 5 months ago (2009-07-10 19:25:16 UTC) #5
eroman
LGTM http://codereview.chromium.org/149191/diff/1038/19 File net/proxy/proxy_service_unittest.cc (right): http://codereview.chromium.org/149191/diff/1038/19#newcode964 Line 964: SyncProxyService service2(new MockProxyConfigService(config), On 2009/07/10 19:25:17, Arindam ...
11 years, 5 months ago (2009-07-10 21:24:46 UTC) #6
Arindam
Please have a look at http://codereview.chromium.org/149191/diff/1067/61#newcode36 http://codereview.chromium.org/149191/diff/1067/56#newcode80 http://codereview.chromium.org/149191/diff/1067/56 File net/proxy/proxy_config.cc (right): http://codereview.chromium.org/149191/diff/1067/56#newcode80 Line 80: if ...
11 years, 5 months ago (2009-07-11 00:53:34 UTC) #7
eroman
11 years, 5 months ago (2009-07-13 23:41:31 UTC) #8
LGTM.

http://codereview.chromium.org/149191/diff/1067/56
File net/proxy/proxy_config.cc (right):

http://codereview.chromium.org/149191/diff/1067/56#newcode80
Line 80: if (proxy_server != NULL && proxy_server->is_valid())
On 2009/07/11 00:53:35, Arindam wrote:
> On 2009/07/10 21:24:46, eroman wrote:
> > nit: leave off the "!= NULL" .
> 
> We need this, in case the url_scheme is invalid, then MapSchemeToProxy returns
> NULL. This is required for this case :
> http://codereview.chromium.org/149191/diff/1079/76#oldcode184

What I mean was purely a stylistic comment:

Rewrite 
  if (proxy_server != NULL && proxy_server->is_valid())
AS:
  if (proxy_server && proxy_server->is_valid())

(We prefer the former style in the network code.)

http://codereview.chromium.org/149191/diff/1067/61
File net/proxy/proxy_config_service_common_unittest.h (right):

http://codereview.chromium.org/149191/diff/1067/61#newcode36
Line 36: const char* socks_proxy);
On 2009/07/11 00:53:35, Arindam wrote:
> I am wondering whether this is acceptable google code. I let
> MakeProxyPerSchemeRules have an optional parameter by polymorphing it.

Yep, this is fine.

For test code, it is perfectly valid to do these sorts of things for
convenience. It for non-test code that one needs to be more skeptical of
function overloading (since it can be a source of bugs/misunderstandings).

http://codereview.chromium.org/149191/diff/1079/87
File net/proxy/proxy_config_service_linux.cc (right):

http://codereview.chromium.org/149191/diff/1079/87#newcode58
Line 58: // TODO(arindam): Remove URI string manipulation by using
MapUrlSchemeToProxy.
OK.

Although specifically the cleanup I was thinking was to simply pass in a default
scheme. I.E the the _caller_ of FixupProxyHostScheme() currently ends up doing:

ProxyServer proxy_server =
    ProxyServer::FromURI(env_value, ProxyServer::SCHEME_HTTP);

Really instead of SCHEME_HTTP, they should be passing SCHEME_SOCKS4 /
SCHEME_SOCKS5 in the case where the env value is for a SOCKS proxy type (so
FixupProxyHostScheme() doesn't need to complete it to a full scheme://host
string).

http://codereview.chromium.org/149191/diff/1079/88
File net/proxy/proxy_config_service_win_unittest.cc (right):

http://codereview.chromium.org/149191/diff/1079/88#newcode117
Line 117: L"ftp=ftpproxy:20;socks=foopy:130",                // lpszProxy
nit: one less space to lineup the comment :)

http://codereview.chromium.org/149191/diff/1079/88#newcode124
Line 124: MakeProxyPerSchemeRules("www.google.com:80", "www.foo.com:110",
Thanks!

Powered by Google App Engine
This is Rietveld 408576698