summaryrefslogtreecommitdiffstats
path: root/net/http/http_network_transaction.cc
diff options
context:
space:
mode:
authorasanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-29 16:21:57 +0000
committerasanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-29 16:21:57 +0000
commit8e7177727ef18e2fdb0f2ad05e6c39da10265797 (patch)
treeef8960c18ef613cbec74f8346ecca168c1df8d10 /net/http/http_network_transaction.cc
parentd685a68049c3bacf00e108afe1da6a0807b2ab3c (diff)
downloadchromium_src-8e7177727ef18e2fdb0f2ad05e6c39da10265797.zip
chromium_src-8e7177727ef18e2fdb0f2ad05e6c39da10265797.tar.gz
chromium_src-8e7177727ef18e2fdb0f2ad05e6c39da10265797.tar.bz2
Re-connect if Keep-Alive connection has been closed by the time we get around to reusing it.
BUG=none TEST=net_unittests --gtest_filter=HttpNetworkTransactionTest.BasicAuthKeepAliveImpatientServer:*.BasicAuthKeepAliveNoBody:*.BasicAuthKeepAliveLargeBody && unit_tests --gtest_filter=*TransportClientSocketTest.IsConnected* Review URL: http://codereview.chromium.org/6878055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83524 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_network_transaction.cc')
-rw-r--r--net/http/http_network_transaction.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index 46858e6..5cd2f92 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -273,7 +273,7 @@ void HttpNetworkTransaction::DidDrainBodyForAuthRestart(bool keep_alive) {
if (stream_.get()) {
HttpStream* new_stream = NULL;
- if (keep_alive) {
+ if (keep_alive && stream_->IsConnectionReusable()) {
// We should call connection_->set_idle_time(), but this doesn't occur
// often enough to be worth the trouble.
stream_->SetConnectionReused();
@@ -281,7 +281,10 @@ void HttpNetworkTransaction::DidDrainBodyForAuthRestart(bool keep_alive) {
}
if (!new_stream) {
- stream_->Close(!keep_alive);
+ // Close the stream and mark it as not_reusable. Even in the
+ // keep_alive case, we've determined that the stream_ is not
+ // reusable if new_stream is NULL.
+ stream_->Close(true);
next_state_ = STATE_CREATE_STREAM;
} else {
next_state_ = STATE_INIT_STREAM;