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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 QuicConnectionId connection_id, | 655 QuicConnectionId connection_id, |
656 const QuicPacketHeader& header) { | 656 const QuicPacketHeader& header) { |
657 // TODO(rch): This logic should probably live completely inside the rejector. | 657 // TODO(rch): This logic should probably live completely inside the rejector. |
658 if (!FLAGS_quic_use_cheap_stateless_rejects || | 658 if (!FLAGS_quic_use_cheap_stateless_rejects || |
659 !FLAGS_enable_quic_stateless_reject_support || | 659 !FLAGS_enable_quic_stateless_reject_support || |
660 header.public_header.versions.front() <= QUIC_VERSION_32 || | 660 header.public_header.versions.front() <= QUIC_VERSION_32 || |
661 !ShouldAttemptCheapStatelessRejection()) { | 661 !ShouldAttemptCheapStatelessRejection()) { |
662 return kFateProcess; | 662 return kFateProcess; |
663 } | 663 } |
664 | 664 |
665 StatelessRejector rejector(header.public_header.versions.front(), | 665 StatelessRejector rejector( |
666 GetSupportedVersions(), crypto_config_, | 666 header.public_header.versions.front(), GetSupportedVersions(), |
667 &compressed_certs_cache_, helper()->GetClock(), | 667 crypto_config_, &compressed_certs_cache_, helper()->GetClock(), |
668 helper()->GetRandomGenerator(), | 668 helper()->GetRandomGenerator(), current_packet_->length(), |
669 current_client_address_, current_server_address_); | 669 current_client_address_, current_server_address_); |
670 ChloValidator validator(session_helper_.get(), current_server_address_, | 670 ChloValidator validator(session_helper_.get(), current_server_address_, |
671 &rejector); | 671 &rejector); |
672 if (!ChloExtractor::Extract(*current_packet_, GetSupportedVersions(), | 672 if (!ChloExtractor::Extract(*current_packet_, GetSupportedVersions(), |
673 &validator)) { | 673 &validator)) { |
674 DVLOG(1) << "Buffering undecryptable packet."; | 674 DVLOG(1) << "Buffering undecryptable packet."; |
675 buffered_packets_.EnqueuePacket(connection_id, *current_packet_, | 675 buffered_packets_.EnqueuePacket(connection_id, *current_packet_, |
676 current_server_address_, | 676 current_server_address_, |
677 current_client_address_); | 677 current_client_address_); |
678 return kFateDrop; | 678 return kFateDrop; |
679 } | 679 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 | 719 |
720 QUIC_BUG << "Rejector has unknown invalid state."; | 720 QUIC_BUG << "Rejector has unknown invalid state."; |
721 return kFateDrop; | 721 return kFateDrop; |
722 } | 722 } |
723 | 723 |
724 const QuicVersionVector& QuicDispatcher::GetSupportedVersions() { | 724 const QuicVersionVector& QuicDispatcher::GetSupportedVersions() { |
725 return version_manager_->GetSupportedVersions(); | 725 return version_manager_->GetSupportedVersions(); |
726 } | 726 } |
727 | 727 |
728 } // namespace net | 728 } // namespace net |
OLD | NEW |