| Index: net/tools/quic/quic_dispatcher.cc
|
| diff --git a/net/tools/quic/quic_dispatcher.cc b/net/tools/quic/quic_dispatcher.cc
|
| index 486aea70a3eb36947b0af412b27756a54ab86fd7..c65929e6d57b8cc00e53a6102cdd5bb58fec00a8 100644
|
| --- a/net/tools/quic/quic_dispatcher.cc
|
| +++ b/net/tools/quic/quic_dispatcher.cc
|
| @@ -325,12 +325,21 @@ bool QuicDispatcher::OnUnauthenticatedHeader(const QuicPacketHeader& header) {
|
| return false;
|
| }
|
|
|
| - // Packet's connection ID is unknown.
|
| - // Apply the validity checks.
|
| + // Packet's connection ID is unknown. Apply the validity checks.
|
| QuicPacketFate fate = ValidityChecks(header);
|
| if (fate == kFateProcess) {
|
| fate = MaybeRejectStatelessly(connection_id, header);
|
| }
|
| +
|
| + // Perform whatever actions are needed on the current packet.
|
| + ProcessUnauthenticatedHeaderFate(fate, connection_id, header.packet_number);
|
| + return false;
|
| +}
|
| +
|
| +void QuicDispatcher::ProcessUnauthenticatedHeaderFate(
|
| + QuicPacketFate fate,
|
| + QuicConnectionId connection_id,
|
| + QuicPacketNumber packet_number) {
|
| switch (fate) {
|
| case kFateProcess: {
|
| ProcessChlo();
|
| @@ -340,8 +349,7 @@ bool QuicDispatcher::OnUnauthenticatedHeader(const QuicPacketHeader& header) {
|
| // MaybeRejectStatelessly might have already added the connection to
|
| // time wait, in which case it should not be added again.
|
| if (!FLAGS_quic_use_cheap_stateless_rejects ||
|
| - !time_wait_list_manager_->IsConnectionIdInTimeWait(
|
| - header.public_header.connection_id)) {
|
| + !time_wait_list_manager_->IsConnectionIdInTimeWait(connection_id)) {
|
| // Add this connection_id to the time-wait state, to safely reject
|
| // future packets.
|
| DVLOG(1) << "Adding connection ID " << connection_id
|
| @@ -350,12 +358,10 @@ bool QuicDispatcher::OnUnauthenticatedHeader(const QuicPacketHeader& header) {
|
| connection_id, framer_.version(),
|
| /*connection_rejected_statelessly=*/false, nullptr);
|
| }
|
| - DCHECK(time_wait_list_manager_->IsConnectionIdInTimeWait(
|
| - header.public_header.connection_id));
|
| + DCHECK(time_wait_list_manager_->IsConnectionIdInTimeWait(connection_id));
|
| time_wait_list_manager_->ProcessPacket(
|
| - current_server_address_, current_client_address_,
|
| - header.public_header.connection_id, header.packet_number,
|
| - *current_packet_);
|
| + current_server_address_, current_client_address_, connection_id,
|
| + packet_number, *current_packet_);
|
| break;
|
| case kFateBuffer:
|
| // This packet is a non-CHLO packet which has arrived out of order.
|
| @@ -366,8 +372,6 @@ bool QuicDispatcher::OnUnauthenticatedHeader(const QuicPacketHeader& header) {
|
| // Do nothing with the packet.
|
| break;
|
| }
|
| -
|
| - return false;
|
| }
|
|
|
| QuicDispatcher::QuicPacketFate QuicDispatcher::ValidityChecks(
|
|
|