Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: net/tools/quic/quic_dispatcher.cc

Issue 2519573002: Add a --quic_allow_chlo_buffering flag. Default value is true, no behavior change. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/core/quic_flags_list.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
712 ShouldCreateOrBufferPacketForConnection(connection_id); 712 ShouldCreateOrBufferPacketForConnection(connection_id);
713 } 713 }
714 } 714 }
715 715
716 void QuicDispatcher::ProcessChlo() { 716 void QuicDispatcher::ProcessChlo() {
717 if (FLAGS_quic_create_session_after_insertion && 717 if (FLAGS_quic_create_session_after_insertion &&
718 !buffered_packets_.HasBufferedPackets(current_connection_id_) && 718 !buffered_packets_.HasBufferedPackets(current_connection_id_) &&
719 !ShouldCreateOrBufferPacketForConnection(current_connection_id_)) { 719 !ShouldCreateOrBufferPacketForConnection(current_connection_id_)) {
720 return; 720 return;
721 } 721 }
722 722 if (FLAGS_quic_allow_chlo_buffering &&
723 if (FLAGS_quic_limit_num_new_sessions_per_epoll_loop && 723 FLAGS_quic_limit_num_new_sessions_per_epoll_loop &&
724 new_sessions_allowed_per_event_loop_ <= 0) { 724 new_sessions_allowed_per_event_loop_ <= 0) {
725 // Can't create new session any more. Wait till next event loop. 725 // Can't create new session any more. Wait till next event loop.
726 if (!buffered_packets_.HasChloForConnection(current_connection_id_)) { 726 if (!buffered_packets_.HasChloForConnection(current_connection_id_)) {
727 // Only buffer one CHLO per connection. Remove this condition check when 727 // Only buffer one CHLO per connection. Remove this condition check when
728 // --gfe2_reloadable_flag_quic_buffer_packets_after_chlo 728 // --gfe2_reloadable_flag_quic_buffer_packets_after_chlo
729 // is deprecated because after that retransmitted CHLO should be buffered 729 // is deprecated because after that retransmitted CHLO should be buffered
730 // earlier in OnUnauthenticatedPublicHeader(). 730 // earlier in OnUnauthenticatedPublicHeader().
731 bool is_new_connection = 731 bool is_new_connection =
732 !buffered_packets_.HasBufferedPackets(current_connection_id_); 732 !buffered_packets_.HasBufferedPackets(current_connection_id_);
733 EnqueuePacketResult rs = buffered_packets_.EnqueuePacket( 733 EnqueuePacketResult rs = buffered_packets_.EnqueuePacket(
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 IPEndPoint current_client_address_; 821 IPEndPoint current_client_address_;
822 IPEndPoint current_server_address_; 822 IPEndPoint current_server_address_;
823 std::unique_ptr<QuicReceivedPacket> current_packet_; 823 std::unique_ptr<QuicReceivedPacket> current_packet_;
824 QuicPacketNumber packet_number_; 824 QuicPacketNumber packet_number_;
825 QuicVersion first_version_; 825 QuicVersion first_version_;
826 }; 826 };
827 827
828 void QuicDispatcher::MaybeRejectStatelessly(QuicConnectionId connection_id, 828 void QuicDispatcher::MaybeRejectStatelessly(QuicConnectionId connection_id,
829 const QuicPacketHeader& header) { 829 const QuicPacketHeader& header) {
830 // TODO(rch): This logic should probably live completely inside the rejector. 830 // TODO(rch): This logic should probably live completely inside the rejector.
831 if (!FLAGS_quic_use_cheap_stateless_rejects || 831 if (!FLAGS_quic_allow_chlo_buffering ||
832 !FLAGS_quic_use_cheap_stateless_rejects ||
832 !FLAGS_enable_quic_stateless_reject_support || 833 !FLAGS_enable_quic_stateless_reject_support ||
833 !ShouldAttemptCheapStatelessRejection()) { 834 !ShouldAttemptCheapStatelessRejection()) {
834 // Not use cheap stateless reject. 835 // Not use cheap stateless reject.
835 if (!ChloExtractor::Extract(*current_packet_, GetSupportedVersions(), 836 if (FLAGS_quic_allow_chlo_buffering &&
837 !ChloExtractor::Extract(*current_packet_, GetSupportedVersions(),
836 nullptr)) { 838 nullptr)) {
837 // Buffer non-CHLO packets. 839 // Buffer non-CHLO packets.
838 ProcessUnauthenticatedHeaderFate(kFateBuffer, connection_id, 840 ProcessUnauthenticatedHeaderFate(kFateBuffer, connection_id,
839 header.packet_number); 841 header.packet_number);
840 return; 842 return;
841 } 843 }
842 ProcessUnauthenticatedHeaderFate(kFateProcess, connection_id, 844 ProcessUnauthenticatedHeaderFate(kFateProcess, connection_id,
843 header.packet_number); 845 header.packet_number);
844 return; 846 return;
845 } 847 }
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 void QuicDispatcher::DeliverPacketsToSession( 987 void QuicDispatcher::DeliverPacketsToSession(
986 const std::list<BufferedPacket>& packets, 988 const std::list<BufferedPacket>& packets,
987 QuicSession* session) { 989 QuicSession* session) {
988 for (const BufferedPacket& packet : packets) { 990 for (const BufferedPacket& packet : packets) {
989 session->ProcessUdpPacket(packet.server_address, packet.client_address, 991 session->ProcessUdpPacket(packet.server_address, packet.client_address,
990 *(packet.packet)); 992 *(packet.packet));
991 } 993 }
992 } 994 }
993 995
994 } // namespace net 996 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_flags_list.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698