Add QUIC_BUG_IF to QuicUtils::GetCryptoStreamId
In QUIC versions that use CRYPTO frames (instead of stream 1 frames) for
the crypto handshake, the concept of a "crypto stream ID" makes no
sense, so QuicUtils::GetCryptoStreamId should hit a QUIC_BUG_IF to
prevent its misuse.
gfe-relnote: Add QUIC_BUG_IF protected behind QuicVersionUsesCryptoFrames
PiperOrigin-RevId: 248463613
Change-Id: If6768658e9ffc058778b53a91f95839826602fbf
diff --git a/quic/core/quic_dispatcher.cc b/quic/core/quic_dispatcher.cc
index 831aac5..9af5f84 100644
--- a/quic/core/quic_dispatcher.cc
+++ b/quic/core/quic_dispatcher.cc
@@ -186,7 +186,8 @@
}
offset += frame.crypto_frame->data_length;
}
- if (offset < reject.length()) {
+ if (offset < reject.length() &&
+ !QuicVersionUsesCryptoFrames(framer_.transport_version())) {
DCHECK(!creator_.HasRoomForStreamFrame(
QuicUtils::GetCryptoStreamId(framer_.transport_version()), offset,
frame.stream_frame.data_length));