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

Unified Diff: net/quic/quic_connection.cc

Issue 1009243002: Do not retransmit QUIC data for streams that have been reset. Protected (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Move_QUIC_reads_88573234
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/quic/quic_connection_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_connection.cc
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
index f4d3c5967784e6544ae40d836ca90b134465a992..8d0a310ec0f824ad60eb15e4059a401d65bdae14 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -1121,6 +1121,31 @@ void QuicConnection::SendRstStream(QuicStreamId id,
ScopedPacketBundler ack_bundler(this, BUNDLE_PENDING_ACK);
packet_generator_.AddControlFrame(QuicFrame(new QuicRstStreamFrame(
id, AdjustErrorForVersion(error, version()), bytes_written)));
+ if (!FLAGS_quic_do_not_retransmit_for_reset_streams) {
+ return;
+ }
+
+ sent_packet_manager_.CancelRetransmissionsForStream(id);
+ // Remove all queued packets which only contain data for the reset stream.
+ QueuedPacketList::iterator packet_iterator = queued_packets_.begin();
+ while (packet_iterator != queued_packets_.end()) {
+ RetransmittableFrames* retransmittable_frames =
+ packet_iterator->serialized_packet.retransmittable_frames;
+ if (!retransmittable_frames) {
+ ++packet_iterator;
+ continue;
+ }
+ retransmittable_frames->RemoveFramesForStream(id);
+ if (!retransmittable_frames->frames().empty()) {
+ ++packet_iterator;
+ continue;
+ }
+ delete packet_iterator->serialized_packet.retransmittable_frames;
+ delete packet_iterator->serialized_packet.packet;
+ packet_iterator->serialized_packet.retransmittable_frames = nullptr;
+ packet_iterator->serialized_packet.packet = nullptr;
+ packet_iterator = queued_packets_.erase(packet_iterator);
+ }
}
void QuicConnection::SendWindowUpdate(QuicStreamId id,
« no previous file with comments | « no previous file | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698