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

Issue 201083: Cache login identity for NewFTP transactions. (Closed)

Created:
11 years, 3 months ago by Paweł Hajdan Jr.
Modified:
9 years, 7 months ago
Reviewers:
eroman, wtc
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Cache login identity for NewFTP transactions. TEST=net_unittests BUG=21184 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=26815

Patch Set 1 #

Total comments: 1

Patch Set 2 : only remove when matching #

Total comments: 8

Patch Set 3 : fixes #

Patch Set 4 : fix compile on win #

Total comments: 4

Patch Set 5 : better #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+316 lines, -137 lines) Patch
A net/data/ftp/testfile View 1 chunk +1 line, -0 lines 0 comments Download
M net/ftp/ftp_auth_cache.h View 2 3 4 2 chunks +26 lines, -22 lines 0 comments Download
M net/ftp/ftp_auth_cache.cc View 2 2 chunks +17 lines, -18 lines 0 comments Download
M net/ftp/ftp_auth_cache_unittest.cc View 2 3 chunks +59 lines, -46 lines 0 comments Download
M net/socket/ssl_test_util.h View 2 chunks +6 lines, -0 lines 0 comments Download
M net/socket/ssl_test_util.cc View 3 chunks +11 lines, -4 lines 0 comments Download
M net/tools/testserver/testserver.py View 2 chunks +6 lines, -2 lines 1 comment Download
M net/url_request/url_request_ftp_job.cc View 2 chunks +6 lines, -3 lines 0 comments Download
M net/url_request/url_request_new_ftp_job.cc View 1 2 3 4 3 chunks +33 lines, -3 lines 2 comments Download
M net/url_request/url_request_unittest.h View 2 chunks +6 lines, -1 line 0 comments Download
M net/url_request/url_request_unittest.cc View 1 2 3 4 14 chunks +145 lines, -38 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Paweł Hajdan Jr.
eroman, you suggested earlier that the transaction should succeed when auth fails. I can make ...
11 years, 3 months ago (2009-09-10 19:51:25 UTC) #1
Paweł Hajdan Jr.
ping
11 years, 3 months ago (2009-09-11 22:05:27 UTC) #2
eroman
http://codereview.chromium.org/201083/diff/1/2 File net/url_request/url_request_new_ftp_job.cc (right): http://codereview.chromium.org/201083/diff/1/2#newcode372 Line 372: request_->context()->ftp_auth_cache()->Remove(origin); This could end up invalidating an auth ...
11 years, 3 months ago (2009-09-11 23:02:52 UTC) #3
Paweł Hajdan Jr.
Good catch, fixed (with a test).
11 years, 3 months ago (2009-09-14 16:23:44 UTC) #4
wtc
LGTM. http://codereview.chromium.org/201083/diff/2002/4002 File net/ftp/ftp_auth_cache.h (right): http://codereview.chromium.org/201083/diff/2002/4002#newcode38 Line 38: void Add(const GURL& origin, AuthData* auth_data); The ...
11 years, 3 months ago (2009-09-15 02:05:45 UTC) #5
eroman
This is inconsistent with how embedded URLs are treated -- they too should be added ...
11 years, 3 months ago (2009-09-15 21:39:06 UTC) #6
Paweł Hajdan Jr.
I think I fixed the issues. I also added a test to prove that username@password ...
11 years, 3 months ago (2009-09-16 16:12:38 UTC) #7
wtc
LGTM. http://codereview.chromium.org/201083/diff/7/8002 File net/ftp/ftp_auth_cache.h (right): http://codereview.chromium.org/201083/diff/7/8002#newcode29 Line 29: Entry(const GURL& origin, const std::wstring& username, Nit: ...
11 years, 3 months ago (2009-09-16 18:16:48 UTC) #8
eroman
> I also added a test to prove that username@password > embedded in the URL ...
11 years, 3 months ago (2009-09-17 02:50:37 UTC) #9
Paweł Hajdan Jr.
Indeed, the change was not working properly for embedded identity. Fixed, and added more reliable ...
11 years, 3 months ago (2009-09-21 19:42:04 UTC) #10
eroman
looks good; a couple comments (which you don't have to address). http://codereview.chromium.org/201083/diff/11002/12007 File net/tools/testserver/testserver.py (right): ...
11 years, 3 months ago (2009-09-22 07:42:21 UTC) #11
Paweł Hajdan Jr.
11 years, 3 months ago (2009-09-22 16:15:58 UTC) #12
On 2009/09/22 07:42:21, eroman wrote:
> looks good; a couple comments (which you don't have to address).
> 
> http://codereview.chromium.org/201083/diff/11002/12007
> File net/tools/testserver/testserver.py (right):
> 
> http://codereview.chromium.org/201083/diff/11002/12007#newcode1145
> Line 1145: option_parser.add_option('--ftp-enable-anonymous',
> action='store_true',
> It might be more convenient to invert the direction of this flag (enable
> anonymous FTP by default, require a flag to disable it)

I also considered that. For now we have only one test for anonymous FTP, and 5+
for non-anonymous, which makes the current choice look better. Maybe in the
future the proportion will change.

> http://codereview.chromium.org/201083/diff/11002/12009
> File net/url_request/url_request_new_ftp_job.cc (right):
> 
> http://codereview.chromium.org/201083/diff/11002/12009#newcode372
> Line 372: request_->context()->ftp_auth_cache()->Add(origin, username,
> password);
> Ok. Note that for HTTP we only save it to the cache if a challenge was
received
> (we do all of the auth cache logic as part of the transaction rather than the
> job).

Makes sense. I think I will fix that, in the future. For now I mostly used logic
from the old ftp job.

> http://codereview.chromium.org/201083/diff/11002/12009#newcode390
> Line 390: SetAuth(cached_auth->username, cached_auth->password);
> This is kind of awkward that we set it in the cache twice.
> 
> (i.e we have either j added it to the cache, or we have just retrieved it from
> the cache).

Same as above, I'm going to study http transaction more. Thanks for pointing
these out.

Powered by Google App Engine
This is Rietveld 408576698