Add methods to QuicCryptoClientStreamBase to replace num_sent_client_hellos
The use of num_sent_client_hellos is to determine whether a 0-RTT handshake
was done (in which case it is 1) and whether an inchoate REJ was received
in the handshake (in which case it is 3). However, those only work for QUIC
crypto. To make the intention of its use clear and to make it easier to
replace QUIC crypto with TLS, the num_sent_client_hellos method is replaced
with EarlyDataAccepted and ReceivedInchoateReject.
gfe-relnote: no behavior change: adding unused methods
PiperOrigin-RevId: 294307567
Change-Id: I270cab9f702c66dbec6519a68965703a7872b87f
diff --git a/quic/core/quic_crypto_client_stream.h b/quic/core/quic_crypto_client_stream.h
index 01f9612..5af0a66 100644
--- a/quic/core/quic_crypto_client_stream.h
+++ b/quic/core/quic_crypto_client_stream.h
@@ -30,6 +30,9 @@
// is still connected.
virtual bool CryptoConnect() = 0;
+ // DEPRECATED: Use IsResumption, EarlyDataAccepted, and/or
+ // ReceivedInchoateReject instead.
+ //
// num_sent_client_hellos returns the number of client hello messages that
// have been sent. If the handshake has completed then this is one greater
// than the number of round-trips needed for the handshake.
@@ -42,6 +45,15 @@
// complete.
virtual bool IsResumption() const = 0;
+ // Returns true if early data (0-RTT) was accepted in the connection.
+ virtual bool EarlyDataAccepted() const = 0;
+
+ // Returns true if the client received an inchoate REJ during the handshake,
+ // extending the handshake by one round trip. This only applies for QUIC
+ // crypto handshakes. The equivalent feature in IETF QUIC is a Retry packet,
+ // but that is handled at the connection layer instead of the crypto layer.
+ virtual bool ReceivedInchoateReject() const = 0;
+
// The number of server config update messages received by the
// client. Does not count update messages that were received prior
// to handshake confirmation.
@@ -81,6 +93,9 @@
// connection is still connected.
virtual bool CryptoConnect() = 0;
+ // DEPRECATED: Use IsResumption, EarlyDataAccepted, and/or
+ // ReceivedInchoateReject instead.
+ //
// num_sent_client_hellos returns the number of client hello messages that
// have been sent. If the handshake has completed then this is one greater
// than the number of round-trips needed for the handshake.
@@ -93,6 +108,15 @@
// complete.
virtual bool IsResumption() const = 0;
+ // Returns true if early data (0-RTT) was accepted in the connection.
+ virtual bool EarlyDataAccepted() const = 0;
+
+ // Returns true if the client received an inchoate REJ during the handshake,
+ // extending the handshake by one round trip. This only applies for QUIC
+ // crypto handshakes. The equivalent feature in IETF QUIC is a Retry packet,
+ // but that is handled at the connection layer instead of the crypto layer.
+ virtual bool ReceivedInchoateReject() const = 0;
+
// The number of server config update messages received by the
// client. Does not count update messages that were received prior
// to handshake confirmation.
@@ -161,6 +185,8 @@
bool CryptoConnect() override;
int num_sent_client_hellos() const override;
bool IsResumption() const override;
+ bool EarlyDataAccepted() const override;
+ bool ReceivedInchoateReject() const override;
int num_scup_messages_received() const override;