Remove reloadable flag quic_http3_goaway_new_behavior.
PiperOrigin-RevId: 331576745
Change-Id: I299622188b454616d244819cd664f89ccb65dee8
diff --git a/quic/core/http/quic_receive_control_stream.cc b/quic/core/http/quic_receive_control_stream.cc
index 62c9ba8..1367a95 100644
--- a/quic/core/http/quic_receive_control_stream.cc
+++ b/quic/core/http/quic_receive_control_stream.cc
@@ -110,13 +110,6 @@
return false;
}
- if (GetQuicReloadableFlag(quic_http3_goaway_new_behavior)) {
- QUIC_RELOADABLE_FLAG_COUNT(quic_http3_goaway_new_behavior);
- } else if (spdy_session()->perspective() == Perspective::IS_SERVER) {
- OnWrongFrame("Go Away");
- return false;
- }
-
spdy_session()->OnHttp3GoAway(frame.id);
return true;
}
diff --git a/quic/core/http/quic_receive_control_stream_test.cc b/quic/core/http/quic_receive_control_stream_test.cc
index d1db3c4..e908162 100644
--- a/quic/core/http/quic_receive_control_stream_test.cc
+++ b/quic/core/http/quic_receive_control_stream_test.cc
@@ -296,18 +296,8 @@
EXPECT_CALL(debug_visitor, OnGoAwayFrameReceived(goaway));
- if (!GetQuicReloadableFlag(quic_http3_goaway_new_behavior) &&
- perspective() == Perspective::IS_SERVER) {
- EXPECT_CALL(
- *connection_,
- CloseConnection(QUIC_HTTP_FRAME_UNEXPECTED_ON_CONTROL_STREAM, _, _));
- }
-
receive_control_stream_->OnStreamFrame(frame);
- if (GetQuicReloadableFlag(quic_http3_goaway_new_behavior) ||
- perspective() == Perspective::IS_CLIENT) {
- EXPECT_TRUE(session_.goaway_received());
- }
+ EXPECT_TRUE(session_.goaway_received());
}
TEST_P(QuicReceiveControlStreamTest, PushPromiseOnControlStreamShouldClose) {
diff --git a/quic/core/http/quic_spdy_session.cc b/quic/core/http/quic_spdy_session.cc
index 03eb235..e8f4db8 100644
--- a/quic/core/http/quic_spdy_session.cc
+++ b/quic/core/http/quic_spdy_session.cc
@@ -664,42 +664,21 @@
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()) {
- CloseConnectionWithDetails(
- QUIC_HTTP_GOAWAY_ID_LARGER_THAN_PREVIOUS,
- quiche::QuicheStrCat("GOAWAY received with ID ", id,
- " greater than previously received ID ",
- last_received_http3_goaway_id_.value()));
- return;
- }
- last_received_http3_goaway_id_ = id;
-
- if (perspective() == Perspective::IS_SERVER) {
- // TODO(b/151749109): Cancel server pushes with push ID larger than |id|.
- return;
- }
-
- // QuicStreamId is uint32_t. Casting to this narrower type is well-defined
- // and preserves the lower 32 bits. Both IsBidirectionalStreamId() and
- // IsIncomingStream() give correct results, because their return value is
- // determined by the least significant two bits.
- QuicStreamId stream_id = static_cast<QuicStreamId>(id);
- if (!QuicUtils::IsBidirectionalStreamId(stream_id, version()) ||
- IsIncomingStream(stream_id)) {
- CloseConnectionWithDetails(QUIC_HTTP_GOAWAY_INVALID_STREAM_ID,
- "GOAWAY with invalid stream ID");
- return;
- }
-
- // TODO(b/161252736): Cancel client requests with ID larger than |id|.
- // If |id| is larger than numeric_limits<QuicStreamId>::max(), then use
- // max() instead of downcast value.
+ if (last_received_http3_goaway_id_.has_value() &&
+ id > last_received_http3_goaway_id_.value()) {
+ CloseConnectionWithDetails(
+ QUIC_HTTP_GOAWAY_ID_LARGER_THAN_PREVIOUS,
+ quiche::QuicheStrCat("GOAWAY received with ID ", id,
+ " greater than previously received ID ",
+ last_received_http3_goaway_id_.value()));
return;
}
+ last_received_http3_goaway_id_ = id;
- DCHECK_EQ(perspective(), Perspective::IS_CLIENT);
+ if (perspective() == Perspective::IS_SERVER) {
+ // TODO(b/151749109): Cancel server pushes with push ID larger than |id|.
+ return;
+ }
// QuicStreamId is uint32_t. Casting to this narrower type is well-defined
// and preserves the lower 32 bits. Both IsBidirectionalStreamId() and
@@ -708,12 +687,14 @@
QuicStreamId stream_id = static_cast<QuicStreamId>(id);
if (!QuicUtils::IsBidirectionalStreamId(stream_id, version()) ||
IsIncomingStream(stream_id)) {
- CloseConnectionWithDetails(
- QUIC_INVALID_STREAM_ID,
- "GOAWAY's last stream id has to point to a request stream");
+ CloseConnectionWithDetails(QUIC_HTTP_GOAWAY_INVALID_STREAM_ID,
+ "GOAWAY with invalid stream ID");
return;
}
- last_received_http3_goaway_id_ = id;
+
+ // TODO(b/161252736): Cancel client requests with ID larger than |id|.
+ // If |id| is larger than numeric_limits<QuicStreamId>::max(), then use
+ // max() instead of downcast value.
}
bool QuicSpdySession::OnStreamsBlockedFrame(
diff --git a/quic/core/http/quic_spdy_session_test.cc b/quic/core/http/quic_spdy_session_test.cc
index accb2a0..a3c4a52 100644
--- a/quic/core/http/quic_spdy_session_test.cc
+++ b/quic/core/http/quic_spdy_session_test.cc
@@ -1195,9 +1195,6 @@
if (!VersionUsesHttp3(transport_version())) {
return;
}
- if (!GetQuicReloadableFlag(quic_http3_goaway_new_behavior)) {
- return;
- }
EXPECT_FALSE(session_.goaway_received());
PushId push_id1 = 0;
@@ -2770,17 +2767,9 @@
if (!VersionUsesHttp3(transport_version())) {
return;
}
- if (GetQuicReloadableFlag(quic_http3_goaway_new_behavior)) {
- EXPECT_CALL(*connection_,
- CloseConnection(QUIC_HTTP_GOAWAY_INVALID_STREAM_ID,
- "GOAWAY with invalid stream ID", _));
- } else {
- EXPECT_CALL(
- *connection_,
- CloseConnection(
- QUIC_INVALID_STREAM_ID,
- "GOAWAY's last stream id has to point to a request stream", _));
- }
+ EXPECT_CALL(*connection_,
+ CloseConnection(QUIC_HTTP_GOAWAY_INVALID_STREAM_ID,
+ "GOAWAY with invalid stream ID", _));
QuicStreamId stream_id =
GetNthServerInitiatedUnidirectionalStreamId(transport_version(), 0);
session_.OnHttp3GoAway(stream_id);
@@ -2790,9 +2779,6 @@
if (!VersionUsesHttp3(transport_version())) {
return;
}
- if (!GetQuicReloadableFlag(quic_http3_goaway_new_behavior)) {
- return;
- }
EXPECT_FALSE(session_.goaway_received());
QuicStreamId stream_id1 =