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

Unified Diff: net/quic/quic_connection.cc

Issue 1008323002: Land Recent QUIC Changes until 03/15/2015. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0315
Patch Set: Add quic_packet_reader to BUILD.gn to fix compiler errors 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 | « net/quic/crypto/crypto_protocol.h ('k') | 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 524187082ed6d43c8af53e8b1b7d9ff19602ebf9..8d0a310ec0f824ad60eb15e4059a401d65bdae14 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -61,6 +61,9 @@ const size_t kMaxFecGroups = 2;
// Maximum number of acks received before sending an ack in response.
const QuicPacketCount kMaxPacketsReceivedBeforeAckSend = 20;
+// Maximum number of tracked packets.
+const QuicPacketCount kMaxTrackedPackets = 5 * kMaxTcpCongestionWindow;
+
bool Near(QuicPacketSequenceNumber a, QuicPacketSequenceNumber b) {
QuicPacketSequenceNumber delta = (a > b) ? a - b : b - a;
return delta <= kMaxPacketGap;
@@ -1118,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 | « net/quic/crypto/crypto_protocol.h ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698