OLD | NEW |
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/quic_connection.h" | 5 #include "net/quic/quic_connection.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 const QuicPacketSequenceNumber kMaxPacketGap = 5000; | 57 const QuicPacketSequenceNumber kMaxPacketGap = 5000; |
58 | 58 |
59 // Limit the number of FEC groups to two. If we get enough out of order packets | 59 // Limit the number of FEC groups to two. If we get enough out of order packets |
60 // that this becomes limiting, we can revisit. | 60 // that this becomes limiting, we can revisit. |
61 const size_t kMaxFecGroups = 2; | 61 const size_t kMaxFecGroups = 2; |
62 | 62 |
63 // Maximum number of acks received before sending an ack in response. | 63 // Maximum number of acks received before sending an ack in response. |
64 const QuicPacketCount kMaxPacketsReceivedBeforeAckSend = 20; | 64 const QuicPacketCount kMaxPacketsReceivedBeforeAckSend = 20; |
65 | 65 |
66 // Maximum number of tracked packets. | 66 // Maximum number of tracked packets. |
67 const QuicPacketCount kMaxTrackedPackets = 15 * kMaxTcpCongestionWindow; | 67 const QuicPacketCount kMaxTrackedPackets = 5000; |
68 | 68 |
69 bool Near(QuicPacketSequenceNumber a, QuicPacketSequenceNumber b) { | 69 bool Near(QuicPacketSequenceNumber a, QuicPacketSequenceNumber b) { |
70 QuicPacketSequenceNumber delta = (a > b) ? a - b : b - a; | 70 QuicPacketSequenceNumber delta = (a > b) ? a - b : b - a; |
71 return delta <= kMaxPacketGap; | 71 return delta <= kMaxPacketGap; |
72 } | 72 } |
73 | 73 |
74 // An alarm that is scheduled to send an ack if a timeout occurs. | 74 // An alarm that is scheduled to send an ack if a timeout occurs. |
75 class AckAlarm : public QuicAlarm::Delegate { | 75 class AckAlarm : public QuicAlarm::Delegate { |
76 public: | 76 public: |
77 explicit AckAlarm(QuicConnection* connection) | 77 explicit AckAlarm(QuicConnection* connection) |
(...skipping 2101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2179 } | 2179 } |
2180 for (const QuicFrame& frame : retransmittable_frames->frames()) { | 2180 for (const QuicFrame& frame : retransmittable_frames->frames()) { |
2181 if (frame.type == CONNECTION_CLOSE_FRAME) { | 2181 if (frame.type == CONNECTION_CLOSE_FRAME) { |
2182 return true; | 2182 return true; |
2183 } | 2183 } |
2184 } | 2184 } |
2185 return false; | 2185 return false; |
2186 } | 2186 } |
2187 | 2187 |
2188 } // namespace net | 2188 } // namespace net |
OLD | NEW |