summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-05 19:44:09 +0000
committerwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-05 19:44:09 +0000
commit37832c6d285312c7ae3805835bb9eca24fce436a (patch)
tree0a3ff915cfe20d612695fd54bee5125a39a6d6a2 /net
parentec37d38793379facce6e10bafa9b4456efcdd12f (diff)
downloadchromium_src-37832c6d285312c7ae3805835bb9eca24fce436a.zip
chromium_src-37832c6d285312c7ae3805835bb9eca24fce436a.tar.gz
chromium_src-37832c6d285312c7ae3805835bb9eca24fce436a.tar.bz2
Revert r17673, except for the code cleanup.
I will try the real fix (sending the "Proxy-Connection: keep-alive" header with HTTP CONNECT requests) next. R=eroman BUG=http://crbug.com/8771 TEST=none Review URL: http://codereview.chromium.org/114083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17759 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/http/http_network_transaction.cc44
1 files changed, 38 insertions, 6 deletions
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index c8bddaa..1ce3da4 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -241,10 +241,7 @@ void HttpNetworkTransaction::PrepareForAuthRestart(HttpAuth::Target target) {
}
bool keep_alive = false;
- // If the auth scheme is connection-based but the proxy/server mistakenly
- // marks the connection as non-keep-alive, we still keep it alive.
- if (response_.headers->IsKeepAlive() ||
- (auth_handler_[target]->is_connection_based() && has_auth_identity)) {
+ if (response_.headers->IsKeepAlive()) {
// If there is a response body of known length, we need to drain it first.
if (response_body_length_ > 0 || chunked_decoder_.get()) {
next_state_ = STATE_DRAIN_BODY_FOR_AUTH_RESTART;
@@ -256,8 +253,43 @@ void HttpNetworkTransaction::PrepareForAuthRestart(HttpAuth::Target target) {
keep_alive = true;
// response_body_length_ is -1 and we're not using chunked encoding. We
// don't know the length of the response body, so we can't reuse this
- // connection even though the server says it's keep-alive or we need to
- // keep it alive for authentication.
+ // connection even though the server says it's keep-alive.
+ }
+
+ // If the auth scheme is connection-based but the proxy/server mistakenly
+ // marks the connection as non-keep-alive, the auth is going to fail, so log
+ // an error message.
+ if (!keep_alive && auth_handler_[target]->is_connection_based() &&
+ has_auth_identity) {
+ LOG(ERROR) << "Can't perform " << auth_handler_[target]->scheme()
+ << " auth to the " << AuthTargetString(target) << " "
+ << AuthOrigin(target) << " over a non-keep-alive connection";
+
+ HttpVersion http_version = response_.headers->GetHttpVersion();
+ LOG(ERROR) << " HTTP version is " << http_version.major_value() << "."
+ << http_version.minor_value();
+
+ std::string header_val;
+ void* iter = NULL;
+ while (response_.headers->EnumerateHeader(&iter, "connection",
+ &header_val)) {
+ LOG(ERROR) << " Has header Connection: " << header_val;
+ }
+
+ iter = NULL;
+ while (response_.headers->EnumerateHeader(&iter, "proxy-connection",
+ &header_val)) {
+ LOG(ERROR) << " Has header Proxy-Connection: " << header_val;
+ }
+
+ // RFC 4559 requires that a proxy indicate its support of NTLM/Negotiate
+ // authentication with a "Proxy-Support: Session-Based-Authentication"
+ // response header.
+ iter = NULL;
+ while (response_.headers->EnumerateHeader(&iter, "proxy-support",
+ &header_val)) {
+ LOG(ERROR) << " Has header Proxy-Support: " << header_val;
+ }
}
// We don't need to drain the response body, so we act as if we had drained