Notify quic crypto client handshaker about connection close. client side only, protected by existing gfe2_reloadable_flag_quic_notify_handshaker_on_connection_close.
PiperOrigin-RevId: 312677572
Change-Id: I3b36ec2193ceaa40d911abc1e1038cc4c587cc5e
diff --git a/quic/core/quic_crypto_client_handshaker.cc b/quic/core/quic_crypto_client_handshaker.cc
index e93fd07..b031011 100644
--- a/quic/core/quic_crypto_client_handshaker.cc
+++ b/quic/core/quic_crypto_client_handshaker.cc
@@ -171,6 +171,12 @@
return QuicCryptoHandshaker::BufferSizeLimitForLevel(level);
}
+void QuicCryptoClientHandshaker::OnConnectionClosed(
+ QuicErrorCode /*error*/,
+ ConnectionCloseSource /*source*/) {
+ next_state_ = STATE_CONNECTION_CLOSED;
+}
+
void QuicCryptoClientHandshaker::HandleServerConfigUpdateMessage(
const CryptoHandshakeMessage& server_config_update) {
DCHECK(server_config_update.tag() == kSCUP);
@@ -236,6 +242,9 @@
break;
case STATE_NONE:
QUIC_NOTREACHED();
+ return;
+ case STATE_CONNECTION_CLOSED:
+ rv = QUIC_FAILURE;
return; // We are done.
}
} while (rv != QUIC_PENDING && next_state_ != STATE_NONE);
diff --git a/quic/core/quic_crypto_client_handshaker.h b/quic/core/quic_crypto_client_handshaker.h
index 5ba93f2..f99d36e 100644
--- a/quic/core/quic_crypto_client_handshaker.h
+++ b/quic/core/quic_crypto_client_handshaker.h
@@ -53,7 +53,7 @@
void OnOneRttPacketAcknowledged() override {}
void OnHandshakePacketSent() override {}
void OnConnectionClosed(QuicErrorCode /*error*/,
- ConnectionCloseSource /*source*/) override {}
+ ConnectionCloseSource /*source*/) override;
void OnHandshakeDoneReceived() override;
void OnApplicationState(
std::unique_ptr<ApplicationState> /*application_state*/) override {
@@ -103,6 +103,7 @@
STATE_RECV_SHLO,
STATE_INITIALIZE_SCUP,
STATE_NONE,
+ STATE_CONNECTION_CLOSED,
};
// Handles new server config and optional source-address token provided by the