diff options
author | erikchen@google.com <erikchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-19 16:50:53 +0000 |
---|---|---|
committer | erikchen@google.com <erikchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-19 16:50:53 +0000 |
commit | a01ea2207ead85fe7f2a3da9aea662050add3bfb (patch) | |
tree | 62ca3eaa0f61291c93c0fb89fec26f8610da2a97 /net/spdy/spdy_session.cc | |
parent | 05f5654439aa4e5a24e9c4b82225e4f16c352807 (diff) | |
download | chromium_src-a01ea2207ead85fe7f2a3da9aea662050add3bfb.zip chromium_src-a01ea2207ead85fe7f2a3da9aea662050add3bfb.tar.gz chromium_src-a01ea2207ead85fe7f2a3da9aea662050add3bfb.tar.bz2 |
SpdySessionPool closes down sessions accurately now.
This may or may not fix 50265. Regardless, the previous behavior was incorrect.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/3150023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56696 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_session.cc')
-rw-r--r-- | net/spdy/spdy_session.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index 07de80f..c90bdd1 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc @@ -507,7 +507,7 @@ void SpdySession::OnTCPConnect(int result) { if (result != net::OK) { DCHECK_LT(result, 0); - CloseSessionOnError(static_cast<net::Error>(result)); + CloseSessionOnError(static_cast<net::Error>(result), true); return; } else { UpdateConnectionTypeHistograms(CONNECTION_SPDY); @@ -555,7 +555,7 @@ void SpdySession::OnSSLConnect(int result) { ReadSocket(); } else { DCHECK_LT(result, 0); // It should be an error, not a byte count. - CloseSessionOnError(static_cast<net::Error>(result)); + CloseSessionOnError(static_cast<net::Error>(result), true); } } @@ -576,7 +576,7 @@ void SpdySession::OnReadComplete(int bytes_read) { host_port_pair().ToString() << "]."; error = ERR_CONNECTION_CLOSED; } - CloseSessionOnError(error); + CloseSessionOnError(error, true); return; } @@ -650,7 +650,7 @@ void SpdySession::OnWriteComplete(int result) { in_flight_write_.release(); // The stream is now errored. Close it down. - CloseSessionOnError(static_cast<net::Error>(result)); + CloseSessionOnError(static_cast<net::Error>(result), true); } } @@ -671,7 +671,7 @@ net::Error SpdySession::ReadSocket() { switch (bytes_read) { case 0: // Socket is closed! - CloseSessionOnError(ERR_CONNECTION_CLOSED); + CloseSessionOnError(ERR_CONNECTION_CLOSED, true); return ERR_CONNECTION_CLOSED; case net::ERR_IO_PENDING: // Waiting for data. Nothing to do now. @@ -732,7 +732,7 @@ void SpdySession::WriteSocket() { spdy_framer_.CompressFrame(uncompressed_frame)); if (!compressed_frame.get()) { LOG(ERROR) << "SPDY Compression failure"; - CloseSessionOnError(net::ERR_SPDY_PROTOCOL_ERROR); + CloseSessionOnError(net::ERR_SPDY_PROTOCOL_ERROR, true); return; } @@ -824,7 +824,7 @@ void SpdySession::QueueFrame(spdy::SpdyFrame* frame, WriteSocketLater(); } -void SpdySession::CloseSessionOnError(net::Error err) { +void SpdySession::CloseSessionOnError(net::Error err, bool remove_from_pool) { // Closing all streams can have a side-effect of dropping the last reference // to |this|. Hold a reference through this function. scoped_refptr<SpdySession> self(this); @@ -839,7 +839,8 @@ void SpdySession::CloseSessionOnError(net::Error err) { if (state_ != CLOSED) { state_ = CLOSED; error_ = err; - RemoveFromPool(); + if (remove_from_pool) + RemoveFromPool(); CloseAllStreams(err); } } @@ -929,7 +930,7 @@ bool SpdySession::GetSSLCertRequestInfo( void SpdySession::OnError(spdy::SpdyFramer* framer) { LOG(ERROR) << "SpdySession error: " << framer->error_code(); - CloseSessionOnError(net::ERR_SPDY_PROTOCOL_ERROR); + CloseSessionOnError(net::ERR_SPDY_PROTOCOL_ERROR, true); } void SpdySession::OnStreamFrameData(spdy::SpdyStreamId stream_id, |