| 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/tools/quic/quic_time_wait_list_manager.h" | 5 #include "net/tools/quic/quic_time_wait_list_manager.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 | 8 |
| 9 #include "base/containers/hash_tables.h" | |
| 10 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 12 #include "net/base/ip_endpoint.h" | 11 #include "net/base/ip_endpoint.h" |
| 13 #include "net/quic/crypto/crypto_protocol.h" | 12 #include "net/quic/crypto/crypto_protocol.h" |
| 14 #include "net/quic/crypto/quic_decrypter.h" | 13 #include "net/quic/crypto/quic_decrypter.h" |
| 15 #include "net/quic/crypto/quic_encrypter.h" | 14 #include "net/quic/crypto/quic_encrypter.h" |
| 16 #include "net/quic/quic_clock.h" | 15 #include "net/quic/quic_clock.h" |
| 17 #include "net/quic/quic_flags.h" | 16 #include "net/quic/quic_flags.h" |
| 18 #include "net/quic/quic_framer.h" | 17 #include "net/quic/quic_framer.h" |
| 19 #include "net/quic/quic_protocol.h" | 18 #include "net/quic/quic_protocol.h" |
| 20 #include "net/quic/quic_utils.h" | 19 #include "net/quic/quic_utils.h" |
| 21 #include "net/tools/quic/quic_server_session.h" | 20 #include "net/tools/quic/quic_server_session.h" |
| 22 | 21 |
| 23 using base::StringPiece; | 22 using base::StringPiece; |
| 24 | 23 |
| 25 namespace net { | 24 namespace net { |
| 26 namespace tools { | 25 namespace tools { |
| 27 | 26 |
| 28 // TODO(rtenneti): Remove the duplicated code in this file. Share code with | |
| 29 // "net/quic/quic_time_wait_list_manager.cc" | |
| 30 | |
| 31 // A very simple alarm that just informs the QuicTimeWaitListManager to clean | 27 // A very simple alarm that just informs the QuicTimeWaitListManager to clean |
| 32 // up old connection_ids. This alarm should be cancelled and deleted before | 28 // up old connection_ids. This alarm should be cancelled and deleted before |
| 33 // the QuicTimeWaitListManager is deleted. | 29 // the QuicTimeWaitListManager is deleted. |
| 34 class ConnectionIdCleanUpAlarm : public QuicAlarm::Delegate { | 30 class ConnectionIdCleanUpAlarm : public QuicAlarm::Delegate { |
| 35 public: | 31 public: |
| 36 explicit ConnectionIdCleanUpAlarm( | 32 explicit ConnectionIdCleanUpAlarm( |
| 37 QuicTimeWaitListManager* time_wait_list_manager) | 33 QuicTimeWaitListManager* time_wait_list_manager) |
| 38 : time_wait_list_manager_(time_wait_list_manager) { | 34 : time_wait_list_manager_(time_wait_list_manager) { |
| 39 } | 35 } |
| 40 | 36 |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 return; | 305 return; |
| 310 } | 306 } |
| 311 while (num_connections() >= | 307 while (num_connections() >= |
| 312 static_cast<size_t>(FLAGS_quic_time_wait_list_max_connections)) { | 308 static_cast<size_t>(FLAGS_quic_time_wait_list_max_connections)) { |
| 313 MaybeExpireOldestConnection(QuicTime::Infinite()); | 309 MaybeExpireOldestConnection(QuicTime::Infinite()); |
| 314 } | 310 } |
| 315 } | 311 } |
| 316 | 312 |
| 317 } // namespace tools | 313 } // namespace tools |
| 318 } // namespace net | 314 } // namespace net |
| OLD | NEW |