| 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_dispatcher.h" | 5 #include "net/tools/quic/quic_dispatcher.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/debug/stack_trace.h" | 9 #include "base/debug/stack_trace.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 time_wait_list_manager_->AddConnectionIdToTimeWait( | 642 time_wait_list_manager_->AddConnectionIdToTimeWait( |
| 643 connection_id, framer_.version(), false, nullptr); | 643 connection_id, framer_.version(), false, nullptr); |
| 644 } | 644 } |
| 645 | 645 |
| 646 void QuicDispatcher::ProcessBufferedChlos(size_t max_connections_to_create) { | 646 void QuicDispatcher::ProcessBufferedChlos(size_t max_connections_to_create) { |
| 647 // Reset the counter before starting creating connections. | 647 // Reset the counter before starting creating connections. |
| 648 new_sessions_allowed_per_event_loop_ = max_connections_to_create; | 648 new_sessions_allowed_per_event_loop_ = max_connections_to_create; |
| 649 for (; new_sessions_allowed_per_event_loop_ > 0; | 649 for (; new_sessions_allowed_per_event_loop_ > 0; |
| 650 --new_sessions_allowed_per_event_loop_) { | 650 --new_sessions_allowed_per_event_loop_) { |
| 651 QuicConnectionId connection_id; | 651 QuicConnectionId connection_id; |
| 652 list<BufferedPacket> packets = | 652 std::list<BufferedPacket> packets = |
| 653 buffered_packets_.DeliverPacketsForNextConnection(&connection_id); | 653 buffered_packets_.DeliverPacketsForNextConnection(&connection_id); |
| 654 if (packets.empty()) { | 654 if (packets.empty()) { |
| 655 return; | 655 return; |
| 656 } | 656 } |
| 657 QuicSession* session = | 657 QuicSession* session = |
| 658 CreateQuicSession(connection_id, packets.front().client_address); | 658 CreateQuicSession(connection_id, packets.front().client_address); |
| 659 DVLOG(1) << "Created new session for " << connection_id; | 659 DVLOG(1) << "Created new session for " << connection_id; |
| 660 session_map_.insert( | 660 session_map_.insert( |
| 661 std::make_pair(connection_id, base::WrapUnique(session))); | 661 std::make_pair(connection_id, base::WrapUnique(session))); |
| 662 DeliverPacketsToSession(packets, session); | 662 DeliverPacketsToSession(packets, session); |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 998 } | 998 } |
| 999 ProcessUnauthenticatedHeaderFate(fate, rejector->connection_id(), | 999 ProcessUnauthenticatedHeaderFate(fate, rejector->connection_id(), |
| 1000 packet_number); | 1000 packet_number); |
| 1001 } | 1001 } |
| 1002 | 1002 |
| 1003 const QuicVersionVector& QuicDispatcher::GetSupportedVersions() { | 1003 const QuicVersionVector& QuicDispatcher::GetSupportedVersions() { |
| 1004 return version_manager_->GetSupportedVersions(); | 1004 return version_manager_->GetSupportedVersions(); |
| 1005 } | 1005 } |
| 1006 | 1006 |
| 1007 void QuicDispatcher::DeliverPacketsToSession( | 1007 void QuicDispatcher::DeliverPacketsToSession( |
| 1008 const list<BufferedPacket>& packets, | 1008 const std::list<BufferedPacket>& packets, |
| 1009 QuicSession* session) { | 1009 QuicSession* session) { |
| 1010 for (const BufferedPacket& packet : packets) { | 1010 for (const BufferedPacket& packet : packets) { |
| 1011 session->ProcessUdpPacket(packet.server_address, packet.client_address, | 1011 session->ProcessUdpPacket(packet.server_address, packet.client_address, |
| 1012 *(packet.packet)); | 1012 *(packet.packet)); |
| 1013 } | 1013 } |
| 1014 } | 1014 } |
| 1015 | 1015 |
| 1016 } // namespace net | 1016 } // namespace net |
| OLD | NEW |