Add version DCHECKS in GOAWAY handling. Sometimes in tests, QuicSession::OnGoAway is called directly no matter what the version is, but GoAway and Http3GoAway are 2 different frames. This change prevents that from happening. Chrome tests are already fixed at https://chromium-review.googlesource.com/c/chromium/src/+/2341396 No behavior change. not protected. PiperOrigin-RevId: 325528159 Change-Id: Ied46967ce3bf1cf44ba04be6476c407a86ba3aa2
diff --git a/quic/core/http/quic_spdy_session.cc b/quic/core/http/quic_spdy_session.cc index c1b7661..ece418c 100644 --- a/quic/core/http/quic_spdy_session.cc +++ b/quic/core/http/quic_spdy_session.cc
@@ -657,6 +657,9 @@ } void QuicSpdySession::OnHttp3GoAway(uint64_t id) { + QUIC_BUG_IF(!version().UsesHttp3()) + << "HTTP/3 GOAWAY received on version " << version(); + if (GetQuicReloadableFlag(quic_http3_goaway_new_behavior)) { if (last_received_http3_goaway_id_.has_value() && id > last_received_http3_goaway_id_.value()) {
diff --git a/quic/core/quic_session.cc b/quic/core/quic_session.cc index 926038a..f26ff27 100644 --- a/quic/core/quic_session.cc +++ b/quic/core/quic_session.cc
@@ -347,6 +347,9 @@ } void QuicSession::OnGoAway(const QuicGoAwayFrame& /*frame*/) { + QUIC_BUG_IF(version().UsesHttp3()) + << "gQUIC GOAWAY received on version " << version(); + goaway_received_ = true; }