gfe-relnote: Change error code sent on unknown unidirectional stream type. Protected by gfe2_reloadable_flag_quic_enable_version_draft_25_v3 and gfe2_reloadable_flag_quic_enable_version_draft_27. From https://quicwg.org/base-drafts/draft-ietf-quic-http.html#name-unidirectional-streams: "Recipients of unknown stream types MAY abort reading of the stream with an error code of H3_STREAM_CREATION_ERROR" This CL changes the error code sent from 0xd to 0x103. PiperOrigin-RevId: 300521130 Change-Id: I11843f7342c8aee0ce9c012e5fab631ee9a31df2
diff --git a/quic/core/http/quic_spdy_session.cc b/quic/core/http/quic_spdy_session.cc index e46ea5d..c8d28c1 100644 --- a/quic/core/http/quic_spdy_session.cc +++ b/quic/core/http/quic_spdy_session.cc
@@ -57,9 +57,6 @@ #define ENDPOINT \ (perspective() == Perspective::IS_SERVER ? "Server: " : "Client: ") -// TODO(b/124216424): remove this once HTTP/3 error codes are adopted. -const uint16_t kHttpUnknownStreamType = 0x0D; - class HeaderTableDebugVisitor : public HpackHeaderTable::DebugVisitorInterface { public: HeaderTableDebugVisitor(const QuicClock* clock, @@ -1109,7 +1106,10 @@ return true; } default: - SendStopSending(kHttpUnknownStreamType, pending->id()); + SendStopSending( + static_cast<QuicApplicationErrorCode>( + QuicHttp3ErrorCode::IETF_QUIC_HTTP3_STREAM_CREATION_ERROR), + pending->id()); pending->StopReading(); } return false;
diff --git a/quic/core/http/quic_spdy_session_test.cc b/quic/core/http/quic_spdy_session_test.cc index bd62260..c0a1269 100644 --- a/quic/core/http/quic_spdy_session_test.cc +++ b/quic/core/http/quic_spdy_session_test.cc
@@ -2227,7 +2227,17 @@ // A STOP_SENDING frame is sent in response to the unknown stream type. EXPECT_CALL(*connection_, SendControlFrame(_)) - .WillOnce(Invoke(&VerifyAndClearStopSendingFrame)); + .WillOnce(Invoke([stream_id](const QuicFrame& frame) { + EXPECT_EQ(STOP_SENDING_FRAME, frame.type); + + QuicStopSendingFrame* stop_sending = frame.stop_sending_frame; + EXPECT_EQ(stream_id, stop_sending->stream_id); + EXPECT_EQ(QuicHttp3ErrorCode::IETF_QUIC_HTTP3_STREAM_CREATION_ERROR, + static_cast<QuicHttp3ErrorCode>( + stop_sending->application_error_code)); + + return ClearControlFrame(frame); + })); session_.OnStreamFrame(frame); PendingStream* pending =