Implement the QuicTransport server session subclass.
This currently does not handle incoming streams, as those require special logic to prevent access to application data before the indication is received.
gfe-relnote: n/a (not used in production)
PiperOrigin-RevId: 274228824
Change-Id: Ie1cd37ecfb739d1242a3cdc40186bca00f8373fd
diff --git a/quic/core/quic_crypto_client_stream_test.cc b/quic/core/quic_crypto_client_stream_test.cc
index 1001301..8e1ef25 100644
--- a/quic/core/quic_crypto_client_stream_test.cc
+++ b/quic/core/quic_crypto_client_stream_test.cc
@@ -51,6 +51,9 @@
session_ = std::make_unique<TestQuicSpdyClientSession>(
connection_, DefaultQuicConfig(), supported_versions_, server_id_,
&crypto_config_);
+ EXPECT_CALL(*session_, GetAlpnsToOffer())
+ .WillRepeatedly(testing::Return(std::vector<std::string>(
+ {AlpnForVersion(connection_->version())})));
}
void CompleteCryptoHandshake() {
diff --git a/quic/core/quic_crypto_server_stream_test.cc b/quic/core/quic_crypto_server_stream_test.cc
index 8d71f26..360c268 100644
--- a/quic/core/quic_crypto_server_stream_test.cc
+++ b/quic/core/quic_crypto_server_stream_test.cc
@@ -132,7 +132,8 @@
return crypto_test_utils::HandshakeWithFakeClient(
helpers_.back().get(), alarm_factories_.back().get(),
- server_connection_, server_stream(), server_id_, client_options_);
+ server_connection_, server_stream(), server_id_, client_options_,
+ /*alpn=*/"");
}
// Performs a single round of handshake message-exchange between the
diff --git a/quic/core/quic_error_codes.cc b/quic/core/quic_error_codes.cc
index e69cd60..b1e8ed2 100644
--- a/quic/core/quic_error_codes.cc
+++ b/quic/core/quic_error_codes.cc
@@ -159,6 +159,7 @@
RETURN_STRING_LITERAL(
QUIC_WINDOW_UPDATE_RECEIVED_ON_READ_UNIDIRECTIONAL_STREAM);
RETURN_STRING_LITERAL(QUIC_TOO_MANY_BUFFERED_CONTROL_FRAMES);
+ RETURN_STRING_LITERAL(QUIC_TRANSPORT_INVALID_CLIENT_INDICATION);
RETURN_STRING_LITERAL(QUIC_LAST_ERROR);
// Intentionally have no default case, so we'll break the build
diff --git a/quic/core/quic_error_codes.h b/quic/core/quic_error_codes.h
index 298029f..ce5c721 100644
--- a/quic/core/quic_error_codes.h
+++ b/quic/core/quic_error_codes.h
@@ -339,8 +339,11 @@
// There are too many buffered control frames in control frame manager.
QUIC_TOO_MANY_BUFFERED_CONTROL_FRAMES = 124,
+ // QuicTransport received invalid client indication.
+ QUIC_TRANSPORT_INVALID_CLIENT_INDICATION = 125,
+
// No error. Used as bound while iterating.
- QUIC_LAST_ERROR = 125,
+ QUIC_LAST_ERROR = 126,
};
// QuicErrorCodes is encoded as four octets on-the-wire when doing Google QUIC,
// or a varint62 when doing IETF QUIC. Ensure that its value does not exceed
diff --git a/quic/core/quic_types.cc b/quic/core/quic_types.cc
index 499bc66..db48c5c 100644
--- a/quic/core/quic_types.cc
+++ b/quic/core/quic_types.cc
@@ -411,6 +411,8 @@
case QUIC_TOO_MANY_BUFFERED_CONTROL_FRAMES:
return {true,
{static_cast<uint64_t>(QUIC_TOO_MANY_BUFFERED_CONTROL_FRAMES)}};
+ case QUIC_TRANSPORT_INVALID_CLIENT_INDICATION:
+ return {false, {0u}};
case QUIC_LAST_ERROR:
return {false, {static_cast<uint64_t>(QUIC_LAST_ERROR)}};
}