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 // Handles packets for connection_ids in time wait state by discarding the | 5 // Handles packets for connection_ids in time wait state by discarding the |
6 // packet and sending the clients a public reset packet with exponential | 6 // packet and sending the clients a public reset packet with exponential |
7 // backoff. | 7 // backoff. |
8 | 8 |
9 #ifndef NET_TOOLS_QUIC_QUIC_TIME_WAIT_LIST_MANAGER_H_ | 9 #ifndef NET_TOOLS_QUIC_QUIC_TIME_WAIT_LIST_MANAGER_H_ |
10 #define NET_TOOLS_QUIC_QUIC_TIME_WAIT_LIST_MANAGER_H_ | 10 #define NET_TOOLS_QUIC_QUIC_TIME_WAIT_LIST_MANAGER_H_ |
(...skipping 26 matching lines...) Expand all Loading... |
37 // wait state. After the connection_id expires its time wait period, a new | 37 // wait state. After the connection_id expires its time wait period, a new |
38 // connection/session will be created if a packet is received for this | 38 // connection/session will be created if a packet is received for this |
39 // connection_id. | 39 // connection_id. |
40 class QuicTimeWaitListManager : public QuicBlockedWriterInterface { | 40 class QuicTimeWaitListManager : public QuicBlockedWriterInterface { |
41 public: | 41 public: |
42 // writer - the entity that writes to the socket. (Owned by the dispatcher) | 42 // writer - the entity that writes to the socket. (Owned by the dispatcher) |
43 // visitor - the entity that manages blocked writers. (The dispatcher) | 43 // visitor - the entity that manages blocked writers. (The dispatcher) |
44 // helper - used to run clean up alarms. (Owned by the dispatcher) | 44 // helper - used to run clean up alarms. (Owned by the dispatcher) |
45 QuicTimeWaitListManager(QuicPacketWriter* writer, | 45 QuicTimeWaitListManager(QuicPacketWriter* writer, |
46 QuicServerSessionVisitor* visitor, | 46 QuicServerSessionVisitor* visitor, |
47 QuicConnectionHelperInterface* helper, | 47 QuicConnectionHelperInterface* helper); |
48 const QuicVersionVector& supported_versions); | |
49 ~QuicTimeWaitListManager() override; | 48 ~QuicTimeWaitListManager() override; |
50 | 49 |
51 // Adds the given connection_id to time wait state for time_wait_period_. | 50 // Adds the given connection_id to time wait state for time_wait_period_. |
52 // Henceforth, any packet bearing this connection_id should not be processed | 51 // Henceforth, any packet bearing this connection_id should not be processed |
53 // while the connection_id remains in this list. If a non-nullptr | 52 // while the connection_id remains in this list. If a non-nullptr |
54 // |close_packet| is provided, the TimeWaitListManager takes ownership of it | 53 // |close_packet| is provided, the TimeWaitListManager takes ownership of it |
55 // and sends it again when packets are received for added connection_ids. If | 54 // and sends it again when packets are received for added connection_ids. If |
56 // nullptr, a public reset packet is sent with the specified |version|. | 55 // nullptr, a public reset packet is sent with the specified |version|. |
57 // DCHECKs that connection_id is not already on the list. "virtual" to | 56 // DCHECKs that connection_id is not already on the list. "virtual" to |
58 // override in tests. If "connection_rejected_statelessly" is true, it means | 57 // override in tests. If "connection_rejected_statelessly" is true, it means |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 // Interface that manages blocked writers. | 189 // Interface that manages blocked writers. |
191 QuicServerSessionVisitor* visitor_; | 190 QuicServerSessionVisitor* visitor_; |
192 | 191 |
193 DISALLOW_COPY_AND_ASSIGN(QuicTimeWaitListManager); | 192 DISALLOW_COPY_AND_ASSIGN(QuicTimeWaitListManager); |
194 }; | 193 }; |
195 | 194 |
196 } // namespace tools | 195 } // namespace tools |
197 } // namespace net | 196 } // namespace net |
198 | 197 |
199 #endif // NET_TOOLS_QUIC_QUIC_TIME_WAIT_LIST_MANAGER_H_ | 198 #endif // NET_TOOLS_QUIC_QUIC_TIME_WAIT_LIST_MANAGER_H_ |
OLD | NEW |