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 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 } else if (is_new_connection) { | 712 } else if (is_new_connection) { |
713 OnNewConnectionAdded(current_connection_id_); | 713 OnNewConnectionAdded(current_connection_id_); |
714 } | 714 } |
715 } | 715 } |
716 return; | 716 return; |
717 } | 717 } |
718 | 718 |
719 // Creates a new session and process all buffered packets for this connection. | 719 // Creates a new session and process all buffered packets for this connection. |
720 QuicServerSessionBase* session = | 720 QuicServerSessionBase* session = |
721 CreateQuicSession(current_connection_id_, current_client_address_); | 721 CreateQuicSession(current_connection_id_, current_client_address_); |
722 if (FLAGS_quic_enforce_mtu_limit && | |
723 current_packet().potentially_small_mtu()) { | |
724 session->connection()->set_largest_packet_size_supported( | |
725 kMinimumSupportedPacketSize); | |
726 } | |
727 DVLOG(1) << "Created new session for " << current_connection_id_; | 722 DVLOG(1) << "Created new session for " << current_connection_id_; |
728 session_map_.insert(std::make_pair(current_connection_id_, session)); | 723 session_map_.insert(std::make_pair(current_connection_id_, session)); |
729 std::list<BufferedPacket> packets = | 724 std::list<BufferedPacket> packets = |
730 buffered_packets_.DeliverPackets(current_connection_id_); | 725 buffered_packets_.DeliverPackets(current_connection_id_); |
731 // Check if CHLO is the first packet arrived on this connection. | 726 // Check if CHLO is the first packet arrived on this connection. |
732 if (FLAGS_quic_buffer_packet_till_chlo && packets.empty()) { | 727 if (FLAGS_quic_buffer_packet_till_chlo && packets.empty()) { |
733 OnNewConnectionAdded(current_connection_id_); | 728 OnNewConnectionAdded(current_connection_id_); |
734 } | 729 } |
735 // Process CHLO at first. | 730 // Process CHLO at first. |
736 session->ProcessUdpPacket(current_server_address_, current_client_address_, | 731 session->ProcessUdpPacket(current_server_address_, current_client_address_, |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
915 void QuicDispatcher::DeliverPacketsToSession( | 910 void QuicDispatcher::DeliverPacketsToSession( |
916 const std::list<BufferedPacket>& packets, | 911 const std::list<BufferedPacket>& packets, |
917 QuicServerSessionBase* session) { | 912 QuicServerSessionBase* session) { |
918 for (const BufferedPacket& packet : packets) { | 913 for (const BufferedPacket& packet : packets) { |
919 session->ProcessUdpPacket(packet.server_address, packet.client_address, | 914 session->ProcessUdpPacket(packet.server_address, packet.client_address, |
920 *(packet.packet)); | 915 *(packet.packet)); |
921 } | 916 } |
922 } | 917 } |
923 | 918 |
924 } // namespace net | 919 } // namespace net |
OLD | NEW |