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

Unified Diff: net/url_request/url_request_ftp_job.cc

Issue 201083: Cache login identity for NewFTP transactions. (Closed)
Patch Set: better Created 11 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
Index: net/url_request/url_request_ftp_job.cc
diff --git a/net/url_request/url_request_ftp_job.cc b/net/url_request/url_request_ftp_job.cc
index eca845a209e0114a9f3d1854f1e45adfccb4b095..bc7f08516d42ba8eaff4406aac354aa233b51f0e 100644
--- a/net/url_request/url_request_ftp_job.cc
+++ b/net/url_request/url_request_ftp_job.cc
@@ -138,7 +138,8 @@ void URLRequestFtpJob::SendRequest() {
username = WideToUTF8(server_auth_->username);
password = WideToUTF8(server_auth_->password);
request_->context()->ftp_auth_cache()->Add(request_->url().GetOrigin(),
- server_auth_.get());
+ server_auth_->username,
+ server_auth_->password);
} else {
if (request_->url().has_username()) {
username = request_->url().username();
@@ -183,13 +184,15 @@ void URLRequestFtpJob::OnIOComplete(const AsyncResult& result) {
GURL origin = request_->url().GetOrigin();
if (server_auth_ != NULL &&
server_auth_->state == net::AUTH_STATE_HAVE_AUTH) {
- request_->context()->ftp_auth_cache()->Remove(origin);
+ request_->context()->ftp_auth_cache()->Remove(origin,
+ server_auth_->username,
+ server_auth_->password);
} else {
server_auth_ = new net::AuthData();
}
server_auth_->state = net::AUTH_STATE_NEED_AUTH;
- scoped_refptr<net::AuthData> cached_auth =
+ net::FtpAuthCache::Entry* cached_auth =
request_->context()->ftp_auth_cache()->Lookup(origin);
if (cached_auth) {

Powered by Google App Engine
This is Rietveld 408576698