From 0757e770ac9ce685ee0db0179271f1a3dba47cb0 Mon Sep 17 00:00:00 2001 From: "ericroman@google.com" Date: Fri, 27 Mar 2009 04:00:22 +0000 Subject: Respect cookies set in a 401 responses when restarting the http transaction. There are two parts to this change: (1) rebuild the request cookies before each transaction restart for authentication (2) notify the URLRequestHttpJob of header completion before *each* transaction restart for authentication By "each transaction" I mean the automatic restarts that don't require user input, such as: - replying to the first step of NTLM - selecting identity embedded in URL - selecting identity in auth-cache Needing to notify URLRequestHttpJob for these intermediate restarts is a consequence of cookie store management being done outside of HttpNetworkTransaction. After updating the cookie store, URLRequestHttpJob now tests |HttpTransaction::IsReadyToRestartForAuth()| to check whether the notification was informational or an identity is actually needed. R=wtc BUG=6450 Review URL: http://codereview.chromium.org/51004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12635 0039d316-1c4b-4281-b951-d872f2087c98 --- net/http/http_cache.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'net/http/http_cache.cc') diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index 38a8f23..46bb64c 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -166,6 +166,7 @@ class HttpCache::Transaction virtual int RestartWithAuth(const std::wstring& username, const std::wstring& password, CompletionCallback* callback); + virtual bool IsReadyToRestartForAuth(); virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback*); virtual const HttpResponseInfo* GetResponseInfo() const; virtual LoadState GetLoadState() const; @@ -402,6 +403,12 @@ int HttpCache::Transaction::RestartWithAuth( return rv; } +bool HttpCache::Transaction::IsReadyToRestartForAuth() { + if (!network_trans_.get()) + return false; + return network_trans_->IsReadyToRestartForAuth(); +} + int HttpCache::Transaction::Read(IOBuffer* buf, int buf_len, CompletionCallback* callback) { DCHECK(buf); -- cgit v1.1