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

Side by Side Diff: net/spdy/spdy_http_stream.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | net/spdy/spdy_network_transaction_unittest.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include <string> 9 #include <string>
10 10
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 384
385 if (user_callback_) 385 if (user_callback_)
386 DoCallback(status); 386 DoCallback(status);
387 return status; 387 return status;
388 } 388 }
389 389
390 void SpdyHttpStream::OnDataReceived(const char* data, int length) { 390 void SpdyHttpStream::OnDataReceived(const char* data, int length) {
391 // Note that data may be received for a SpdyStream prior to the user calling 391 // Note that data may be received for a SpdyStream prior to the user calling
392 // ReadResponseBody(), therefore user_buffer_ may be NULL. This may often 392 // ReadResponseBody(), therefore user_buffer_ may be NULL. This may often
393 // happen for server initiated streams. 393 // happen for server initiated streams.
394 if (length > 0 && !stream_->closed()) { 394 DCHECK(!stream_->closed() || stream_->pushed());
395 if (length > 0) {
395 // Save the received data. 396 // Save the received data.
396 IOBufferWithSize* io_buffer = new IOBufferWithSize(length); 397 IOBufferWithSize* io_buffer = new IOBufferWithSize(length);
397 memcpy(io_buffer->data(), data, length); 398 memcpy(io_buffer->data(), data, length);
398 response_body_.push_back(io_buffer); 399 response_body_.push_back(io_buffer);
399 400
400 if (user_buffer_) { 401 if (user_buffer_) {
401 // Handing small chunks of data to the caller creates measurable overhead. 402 // Handing small chunks of data to the caller creates measurable overhead.
402 // We buffer data in short time-spans and send a single read notification. 403 // We buffer data in short time-spans and send a single read notification.
403 ScheduleBufferedReadCallback(); 404 ScheduleBufferedReadCallback();
404 } 405 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 stream_->GetSSLInfo(ssl_info, &using_npn); 500 stream_->GetSSLInfo(ssl_info, &using_npn);
500 } 501 }
501 502
502 void SpdyHttpStream::GetSSLCertRequestInfo( 503 void SpdyHttpStream::GetSSLCertRequestInfo(
503 SSLCertRequestInfo* cert_request_info) { 504 SSLCertRequestInfo* cert_request_info) {
504 DCHECK(stream_); 505 DCHECK(stream_);
505 stream_->GetSSLCertRequestInfo(cert_request_info); 506 stream_->GetSSLCertRequestInfo(cert_request_info);
506 } 507 }
507 508
508 } // namespace net 509 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/spdy/spdy_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698