Optimize code in handling wrong HTTP/3 frames. gfe-relnote: v99 only, not protected. PiperOrigin-RevId: 264865143 Change-Id: I88fe384b8f51fd79446a0ec46392e81b845258c0
diff --git a/quic/core/http/quic_receive_control_stream.cc b/quic/core/http/quic_receive_control_stream.cc index 1808a92..0ff9e38 100644 --- a/quic/core/http/quic_receive_control_stream.cc +++ b/quic/core/http/quic_receive_control_stream.cc
@@ -145,11 +145,11 @@ } private: - void CloseConnectionOnWrongFrame(std::string frame_type) { + void CloseConnectionOnWrongFrame(QuicStringPiece frame_type) { // TODO(renjietang): Change to HTTP/3 error type. stream_->session()->connection()->CloseConnection( QUIC_HTTP_DECODER_ERROR, - frame_type + " frame received on control stream", + QuicStrCat(frame_type, " frame received on control stream"), ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); }
diff --git a/quic/core/http/quic_spdy_stream.cc b/quic/core/http/quic_spdy_stream.cc index 464c0a3..dd7d424 100644 --- a/quic/core/http/quic_spdy_stream.cc +++ b/quic/core/http/quic_spdy_stream.cc
@@ -164,9 +164,10 @@ bool OnUnknownFrameEnd() override { return stream_->OnUnknownFrameEnd(); } private: - void CloseConnectionOnWrongFrame(std::string frame_type) { + void CloseConnectionOnWrongFrame(QuicStringPiece frame_type) { stream_->session()->connection()->CloseConnection( - QUIC_HTTP_DECODER_ERROR, frame_type + " frame received on data stream", + QUIC_HTTP_DECODER_ERROR, + QuicStrCat(frame_type, " frame received on data stream"), ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); }