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

Side by Side Diff: net/quic/reliable_quic_stream.cc

Issue 1458003004: Fix bug in ReliableQuicStream::WritevData() where if the write failed and the connection was closed… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@107427162
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « net/quic/quic_connection.h ('k') | net/quic/reliable_quic_stream_test.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/quic/reliable_quic_stream.h" 5 #include "net/quic/reliable_quic_stream.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "net/quic/iovector.h" 8 #include "net/quic/iovector.h"
9 #include "net/quic/quic_ack_listener_interface.h" 9 #include "net/quic/quic_ack_listener_interface.h"
10 #include "net/quic/quic_flags.h" 10 #include "net/quic/quic_flags.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 write_length = static_cast<size_t>(send_window); 318 write_length = static_cast<size_t>(send_window);
319 } 319 }
320 320
321 QuicConsumedData consumed_data = session()->WritevData( 321 QuicConsumedData consumed_data = session()->WritevData(
322 id(), QuicIOVector(iov, iov_count, write_length), stream_bytes_written_, 322 id(), QuicIOVector(iov, iov_count, write_length), stream_bytes_written_,
323 fin, GetFecProtection(), ack_listener); 323 fin, GetFecProtection(), ack_listener);
324 stream_bytes_written_ += consumed_data.bytes_consumed; 324 stream_bytes_written_ += consumed_data.bytes_consumed;
325 325
326 AddBytesSent(consumed_data.bytes_consumed); 326 AddBytesSent(consumed_data.bytes_consumed);
327 327
328 // The write may have generated a write error causing this stream to be
329 // closed. If so, simply return without marking the stream write blocked.
330 if (write_side_closed_) {
331 return consumed_data;
332 }
333
328 if (consumed_data.bytes_consumed == write_length) { 334 if (consumed_data.bytes_consumed == write_length) {
329 if (!fin_with_zero_data) { 335 if (!fin_with_zero_data) {
330 MaybeSendBlocked(); 336 MaybeSendBlocked();
331 } 337 }
332 if (fin && consumed_data.fin_consumed) { 338 if (fin && consumed_data.fin_consumed) {
333 fin_sent_ = true; 339 fin_sent_ = true;
334 if (fin_received_) { 340 if (fin_received_) {
335 session_->StreamDraining(id_); 341 session_->StreamDraining(id_);
336 } 342 }
337 CloseWriteSide(); 343 CloseWriteSide();
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 } 470 }
465 } 471 }
466 472
467 void ReliableQuicStream::UpdateSendWindowOffset(QuicStreamOffset new_window) { 473 void ReliableQuicStream::UpdateSendWindowOffset(QuicStreamOffset new_window) {
468 if (flow_controller_.UpdateSendWindowOffset(new_window)) { 474 if (flow_controller_.UpdateSendWindowOffset(new_window)) {
469 OnCanWrite(); 475 OnCanWrite();
470 } 476 }
471 } 477 }
472 478
473 } // namespace net 479 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection.h ('k') | net/quic/reliable_quic_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698