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

Side by Side Diff: net/spdy/spdy_http_stream.cc

Issue 14311002: [SPDY] Avoid leaking bytes from the session flow control receive window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/spdy/spdy_buffer_unittest.cc ('k') | net/spdy/spdy_proxy_client_socket.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/spdy/spdy_http_stream.h" 5 #include "net/spdy/spdy_http_stream.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <list> 8 #include <list>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 if (stream_) { 129 if (stream_) {
130 CHECK(stream_->is_idle()); 130 CHECK(stream_->is_idle());
131 CHECK(!stream_->closed()); 131 CHECK(!stream_->closed());
132 } 132 }
133 CHECK(buf); 133 CHECK(buf);
134 CHECK(buf_len); 134 CHECK(buf_len);
135 CHECK(!callback.is_null()); 135 CHECK(!callback.is_null());
136 136
137 // If we have data buffered, complete the IO immediately. 137 // If we have data buffered, complete the IO immediately.
138 if (!response_body_queue_.IsEmpty()) { 138 if (!response_body_queue_.IsEmpty()) {
139 size_t bytes_consumed = response_body_queue_.Dequeue(buf->data(), buf_len); 139 return response_body_queue_.Dequeue(buf->data(), buf_len);
140 if (stream_)
141 stream_->IncreaseRecvWindowSize(bytes_consumed);
142 return bytes_consumed;
143 } else if (stream_closed_) { 140 } else if (stream_closed_) {
144 return closed_stream_status_; 141 return closed_stream_status_;
145 } 142 }
146 143
147 CHECK(callback_.is_null()); 144 CHECK(callback_.is_null());
148 CHECK(!user_buffer_); 145 CHECK(!user_buffer_);
149 CHECK_EQ(0, user_buffer_len_); 146 CHECK_EQ(0, user_buffer_len_);
150 147
151 callback_ = callback; 148 callback_ = callback;
152 user_buffer_ = buf; 149 user_buffer_ = buf;
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 bool SpdyHttpStream::IsSpdyHttpStream() const { 565 bool SpdyHttpStream::IsSpdyHttpStream() const {
569 return true; 566 return true;
570 } 567 }
571 568
572 void SpdyHttpStream::Drain(HttpNetworkSession* session) { 569 void SpdyHttpStream::Drain(HttpNetworkSession* session) {
573 Close(false); 570 Close(false);
574 delete this; 571 delete this;
575 } 572 }
576 573
577 } // namespace net 574 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_buffer_unittest.cc ('k') | net/spdy/spdy_proxy_client_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698