summaryrefslogtreecommitdiffstats
path: root/net/spdy/spdy_write_queue.cc
diff options
context:
space:
mode:
authorrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-19 00:50:04 +0000
committerrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-19 00:50:04 +0000
commit38dfd13a2886bd4f002d79d807883c9762f06f44 (patch)
treeb784bd7aa409350de95207c4f256a3a2a8905713 /net/spdy/spdy_write_queue.cc
parenta71d32455848293246db0766650151a2db3c13d4 (diff)
downloadchromium_src-38dfd13a2886bd4f002d79d807883c9762f06f44.zip
chromium_src-38dfd13a2886bd4f002d79d807883c9762f06f44.tar.gz
chromium_src-38dfd13a2886bd4f002d79d807883c9762f06f44.tar.bz2
Correctly handle SPDY GOAWAY frames.
Review URL: https://chromiumcodereview.appspot.com/14232014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195032 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_write_queue.cc')
-rw-r--r--net/spdy/spdy_write_queue.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/net/spdy/spdy_write_queue.cc b/net/spdy/spdy_write_queue.cc
index 18ddc39..e3691e20 100644
--- a/net/spdy/spdy_write_queue.cc
+++ b/net/spdy/spdy_write_queue.cc
@@ -89,6 +89,26 @@ void SpdyWriteQueue::RemovePendingWritesForStream(
queue->erase(out_it, queue->end());
}
+void SpdyWriteQueue::RemovePendingWritesForStreamsAfter(
+ SpdyStreamId last_good_stream_id) {
+ for (int i = 0; i < NUM_PRIORITIES; ++i) {
+ // Do the actual deletion and removal, preserving FIFO-ness.
+ std::deque<PendingWrite>* queue = &queue_[i];
+ std::deque<PendingWrite>::iterator out_it = queue->begin();
+ for (std::deque<PendingWrite>::const_iterator it = queue->begin();
+ it != queue->end(); ++it) {
+ if (it->stream && (it->stream->stream_id() > last_good_stream_id ||
+ it->stream->stream_id() == 0)) {
+ delete it->frame_producer;
+ } else {
+ *out_it = *it;
+ ++out_it;
+ }
+ }
+ queue->erase(out_it, queue->end());
+ }
+}
+
void SpdyWriteQueue::Clear() {
for (int i = 0; i < NUM_PRIORITIES; ++i) {
for (std::deque<PendingWrite>::iterator it = queue_[i].begin();