Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(651)

Unified Diff: net/spdy/spdy_session.cc

Issue 18796003: When an idle socket is added back to a socket pool, check for stalled jobs in lower pools (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Update comments Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_session.h ('k') | net/spdy/spdy_session_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session.cc
===================================================================
--- net/spdy/spdy_session.cc (revision 219027)
+++ net/spdy/spdy_session.cc (working copy)
@@ -517,7 +517,7 @@
error = OK;
if (error == OK) {
DCHECK_NE(availability_state_, STATE_CLOSED);
- connection_->AddLayeredPool(this);
+ connection_->AddHigherLayeredPool(this);
if (enable_sending_initial_data_)
SendInitialData();
pool_ = pool;
@@ -1048,9 +1048,25 @@
// push is hardly used. Write tests for this and fix this. (See
// http://crbug.com/261712 .)
if (owned_stream->type() == SPDY_PUSH_STREAM)
- unclaimed_pushed_streams_.erase(owned_stream->url());
+ unclaimed_pushed_streams_.erase(owned_stream->url());
+ base::WeakPtr<SpdySession> weak_this = GetWeakPtr();
+
DeleteStream(owned_stream.Pass(), status);
+
+ if (!weak_this)
+ return;
+
+ if (availability_state_ == STATE_CLOSED)
+ return;
+
+ // If there are no active streams and the socket pool is stalled, close the
+ // session to free up a socket slot.
+ if (active_streams_.empty() && connection_->IsPoolStalled()) {
+ CloseSessionResult result =
+ DoCloseSession(ERR_CONNECTION_CLOSED, "Closing idle connection.");
+ DCHECK_NE(result, SESSION_ALREADY_CLOSED);
+ }
}
void SpdySession::CloseCreatedStreamIterator(CreatedStreamSet::iterator it,
« no previous file with comments | « net/spdy/spdy_session.h ('k') | net/spdy/spdy_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698