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

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

Issue 1989503002: Add an additional ReliableQuicStream* argument to QuicSession::WritevData in an attempt to defend a… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@122078733
Patch Set: Created 4 years, 7 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
« no previous file with comments | « net/quic/quic_spdy_stream_test.cc ('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_bug_tracker.h" 9 #include "net/quic/quic_bug_tracker.h"
10 #include "net/quic/quic_flags.h" 10 #include "net/quic/quic_flags.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 } 300 }
301 301
302 if (write_length > send_window) { 302 if (write_length > send_window) {
303 // Don't send the FIN unless all the data will be sent. 303 // Don't send the FIN unless all the data will be sent.
304 fin = false; 304 fin = false;
305 305
306 // Writing more data would be a violation of flow control. 306 // Writing more data would be a violation of flow control.
307 write_length = static_cast<size_t>(send_window); 307 write_length = static_cast<size_t>(send_window);
308 } 308 }
309 309
310 QuicConsumedData consumed_data = 310 QuicConsumedData consumed_data = session()->WritevData(
311 session()->WritevData(id(), QuicIOVector(iov, iov_count, write_length), 311 this, id(), QuicIOVector(iov, iov_count, write_length),
312 stream_bytes_written_, fin, ack_listener); 312 stream_bytes_written_, fin, ack_listener);
313 stream_bytes_written_ += consumed_data.bytes_consumed; 313 stream_bytes_written_ += consumed_data.bytes_consumed;
314 314
315 AddBytesSent(consumed_data.bytes_consumed); 315 AddBytesSent(consumed_data.bytes_consumed);
316 316
317 // The write may have generated a write error causing this stream to be 317 // The write may have generated a write error causing this stream to be
318 // closed. If so, simply return without marking the stream write blocked. 318 // closed. If so, simply return without marking the stream write blocked.
319 if (write_side_closed_) { 319 if (write_side_closed_) {
320 return consumed_data; 320 return consumed_data;
321 } 321 }
322 322
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 } 455 }
456 } 456 }
457 457
458 void ReliableQuicStream::UpdateSendWindowOffset(QuicStreamOffset new_window) { 458 void ReliableQuicStream::UpdateSendWindowOffset(QuicStreamOffset new_window) {
459 if (flow_controller_.UpdateSendWindowOffset(new_window)) { 459 if (flow_controller_.UpdateSendWindowOffset(new_window)) {
460 OnCanWrite(); 460 OnCanWrite();
461 } 461 }
462 } 462 }
463 463
464 } // namespace net 464 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_spdy_stream_test.cc ('k') | net/quic/reliable_quic_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698