summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-04 22:18:11 +0000
committerwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-04 22:18:11 +0000
commit04f40b3227b881980574fc94b2cfc01bbbeb1dc0 (patch)
treeafd183626bc15ad5e7215fd079e0e1cb662ebb2e
parent20de1f9566d647c86e3aaef7180fd359d3e0b6f8 (diff)
downloadchromium_src-04f40b3227b881980574fc94b2cfc01bbbeb1dc0.zip
chromium_src-04f40b3227b881980574fc94b2cfc01bbbeb1dc0.tar.gz
chromium_src-04f40b3227b881980574fc94b2cfc01bbbeb1dc0.tar.bz2
Log an error message if the auth scheme is connection-based
but the connection is not marked as keep-alive. R=eroman BUG=8325 Review URL: http://codereview.chromium.org/40093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10925 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--net/http/http_network_transaction.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index ac9502a..9c8208e 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -149,6 +149,36 @@ void HttpNetworkTransaction::PrepareForAuthRestart(HttpAuth::Target target) {
// 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 not keep-alive, the auth is going to fail, so log
+ // an error message.
+ if (!keep_alive && auth_handler_[target]->is_connection_based() &&
+ auth_identity_[target].source != HttpAuth::IDENT_SRC_NONE) {
+ std::string auth_target(target == HttpAuth::AUTH_PROXY ?
+ "proxy" : "server");
+ LOG(ERROR) << "Can't perform " << auth_handler_[target]->scheme()
+ << " auth to the " << auth_target << " "
+ << AuthOrigin(target).spec()
+ << " 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 connection_val;
+ void* iter = NULL;
+ while (response_.headers->EnumerateHeader(&iter, "connection",
+ &connection_val)) {
+ LOG(ERROR) << " Has header Connection: " << connection_val;
+ }
+
+ iter = NULL;
+ while (response_.headers->EnumerateHeader(&iter, "proxy-connection",
+ &connection_val)) {
+ LOG(ERROR) << " Has header Proxy-Connection: " << connection_val;
+ }
+ }
+
// We don't need to drain the response body, so we act as if we had drained
// the response body.
DidDrainBodyForAuthRestart(keep_alive);