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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // This will likely have to be tuned. | 54 // This will likely have to be tuned. |
55 const QuicPacketSequenceNumber kMaxPacketGap = 5000; | 55 const QuicPacketSequenceNumber kMaxPacketGap = 5000; |
56 | 56 |
57 // Limit the number of FEC groups to two. If we get enough out of order packets | 57 // Limit the number of FEC groups to two. If we get enough out of order packets |
58 // that this becomes limiting, we can revisit. | 58 // that this becomes limiting, we can revisit. |
59 const size_t kMaxFecGroups = 2; | 59 const size_t kMaxFecGroups = 2; |
60 | 60 |
61 // Maximum number of acks received before sending an ack in response. | 61 // Maximum number of acks received before sending an ack in response. |
62 const QuicPacketCount kMaxPacketsReceivedBeforeAckSend = 20; | 62 const QuicPacketCount kMaxPacketsReceivedBeforeAckSend = 20; |
63 | 63 |
64 // Maximum number of tracked packets. | |
65 const QuicPacketCount kMaxTrackedPackets = 5 * kMaxTcpCongestionWindow; | |
66 | |
67 bool Near(QuicPacketSequenceNumber a, QuicPacketSequenceNumber b) { | 64 bool Near(QuicPacketSequenceNumber a, QuicPacketSequenceNumber b) { |
68 QuicPacketSequenceNumber delta = (a > b) ? a - b : b - a; | 65 QuicPacketSequenceNumber delta = (a > b) ? a - b : b - a; |
69 return delta <= kMaxPacketGap; | 66 return delta <= kMaxPacketGap; |
70 } | 67 } |
71 | 68 |
72 // An alarm that is scheduled to send an ack if a timeout occurs. | 69 // An alarm that is scheduled to send an ack if a timeout occurs. |
73 class AckAlarm : public QuicAlarm::Delegate { | 70 class AckAlarm : public QuicAlarm::Delegate { |
74 public: | 71 public: |
75 explicit AckAlarm(QuicConnection* connection) | 72 explicit AckAlarm(QuicConnection* connection) |
76 : connection_(connection) { | 73 : connection_(connection) { |
(...skipping 2005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2082 } | 2079 } |
2083 for (const QuicFrame& frame : retransmittable_frames->frames()) { | 2080 for (const QuicFrame& frame : retransmittable_frames->frames()) { |
2084 if (frame.type == CONNECTION_CLOSE_FRAME) { | 2081 if (frame.type == CONNECTION_CLOSE_FRAME) { |
2085 return true; | 2082 return true; |
2086 } | 2083 } |
2087 } | 2084 } |
2088 return false; | 2085 return false; |
2089 } | 2086 } |
2090 | 2087 |
2091 } // namespace net | 2088 } // namespace net |
OLD | NEW |