Index: net/quic/quic_connection.cc |
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc |
index 770e42b6a8161e1bc609239f4511f9dfbb90aa44..b6aa2c00c538d2c776c32abe828c3e80488d6716 100644 |
--- a/net/quic/quic_connection.cc |
+++ b/net/quic/quic_connection.cc |
@@ -54,10 +54,6 @@ const QuicPacketSequenceNumber kMaxPacketGap = 5000; |
// that this becomes limiting, we can revisit. |
const size_t kMaxFecGroups = 2; |
-// Limit the number of undecryptable packets we buffer in |
-// expectation of the CHLO/SHLO arriving. |
-const size_t kMaxUndecryptablePackets = 10; |
- |
// Maximum number of acks received before sending an ack in response. |
const size_t kMaxPacketsReceivedBeforeAckSend = 20; |
@@ -205,6 +201,7 @@ QuicConnection::QuicConnection(QuicConnectionId connection_id, |
last_decrypted_packet_level_(ENCRYPTION_NONE), |
largest_seen_packet_with_ack_(0), |
largest_seen_packet_with_stop_waiting_(0), |
+ max_undecryptable_packets_(0), |
pending_version_negotiation_packet_(false), |
received_packet_manager_(&stats_), |
ack_queued_(false), |
@@ -272,6 +269,7 @@ void QuicConnection::SetFromConfig(const QuicConfig& config) { |
SetIdleNetworkTimeout(config.IdleConnectionStateLifetime()); |
} |
sent_packet_manager_.SetFromConfig(config); |
+ max_undecryptable_packets_ = config.max_undecryptable_packets(); |
} |
bool QuicConnection::SelectMutualVersion( |
@@ -1117,7 +1115,7 @@ void QuicConnection::ProcessUdpPacket(const IPEndPoint& self_address, |
// because the CHLO or SHLO packet was lost. |
if (framer_.error() == QUIC_DECRYPTION_FAILURE) { |
if (encryption_level_ != ENCRYPTION_FORWARD_SECURE && |
- undecryptable_packets_.size() < kMaxUndecryptablePackets) { |
+ undecryptable_packets_.size() < max_undecryptable_packets_) { |
QueueUndecryptablePacket(packet); |
} else if (debug_visitor_.get() != nullptr) { |
debug_visitor_->OnUndecryptablePacket(); |