Remove static stream checks in QuicSession::OnRstStream() and let static sub-streams handle it.
The advantage of having sub stream classes override rather than QuicStream base class sanity check is that HTTP/3 streams are now able to throw HTTP/3 specific errors.
gfe-relnote: no behavior change. not protected.
PiperOrigin-RevId: 299190484
Change-Id: Icaa957f91eba4acb3518515b75d205bc22001ddc
diff --git a/quic/core/quic_crypto_stream.cc b/quic/core/quic_crypto_stream.cc
index b368b61..094613c 100644
--- a/quic/core/quic_crypto_stream.cc
+++ b/quic/core/quic_crypto_stream.cc
@@ -194,6 +194,11 @@
return newly_acked_length > 0;
}
+void QuicCryptoStream::OnStreamReset(const QuicRstStreamFrame& /*frame*/) {
+ stream_delegate()->OnStreamError(QUIC_INVALID_STREAM_ID,
+ "Attempt to reset crypto stream");
+}
+
void QuicCryptoStream::NeuterUnencryptedStreamData() {
if (!QuicVersionUsesCryptoFrames(session()->transport_version())) {
for (const auto& interval : bytes_consumed_[ENCRYPTION_INITIAL]) {