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

Unified Diff: net/spdy/spdy_session.cc

Issue 3108038: Fix bug where pushed SPDY streams were never actually closed.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Will's comments Created 10 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_stream.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 57015)
+++ net/spdy/spdy_session.cc (working copy)
@@ -198,6 +198,10 @@
connection_->socket()->Disconnect();
}
+ // Streams should all be gone now.
+ DCHECK_EQ(0u, num_active_streams());
+ DCHECK_EQ(0u, num_unclaimed_pushed_streams());
+
RecordHistograms();
net_log_.EndEvent(NetLog::TYPE_SPDY_SESSION, NULL);
@@ -781,6 +785,7 @@
if (!unclaimed_pushed_streams_.empty()) {
streams_abandoned_count_ += unclaimed_pushed_streams_.size();
abandoned_push_streams.Add(unclaimed_pushed_streams_.size());
+ unclaimed_pushed_streams_.clear();
}
for (int i = 0;i < NUM_PRIORITIES;++i) {
@@ -854,14 +859,19 @@
void SpdySession::DeleteStream(spdy::SpdyStreamId id, int status) {
DLOG(INFO) << "Removing SpdyStream " << id << " from active stream list.";
- // Remove the stream from unclaimed_pushed_streams_ and active_streams_.
- PushedStreamMap::iterator it;
- for (it = unclaimed_pushed_streams_.begin();
- it != unclaimed_pushed_streams_.end(); ++it) {
- scoped_refptr<SpdyStream> curr = it->second;
- if (id == curr->stream_id()) {
- unclaimed_pushed_streams_.erase(it);
- break;
+
+ // For push streams, if they are being deleted normally, we leave
+ // the stream in the unclaimed_pushed_streams_ list. However, if
+ // the stream is errored out, clean it up entirely.
+ if (status != OK) {
+ PushedStreamMap::iterator it;
+ for (it = unclaimed_pushed_streams_.begin();
+ it != unclaimed_pushed_streams_.end(); ++it) {
+ scoped_refptr<SpdyStream> curr = it->second;
+ if (id == curr->stream_id()) {
+ unclaimed_pushed_streams_.erase(it);
+ break;
+ }
}
}
« no previous file with comments | « net/spdy/spdy_session.h ('k') | net/spdy/spdy_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698