This is an automated email from the ASF dual-hosted git repository. zwoop pushed a commit to branch 9.2.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/9.2.x by this push: new 8e0889f585 Do not overwrite the error code of GOAWAY frame (#10673) 8e0889f585 is described below commit 8e0889f585789addfcc821c1a4193d4e789f7972 Author: Fei Deng <f...@yahooinc.com> AuthorDate: Thu Oct 26 13:18:51 2023 -0400 Do not overwrite the error code of GOAWAY frame (#10673) * do not overwrite the error code of GOAWAY frame (cherry picked from commit b59a8e3c8cc4dfbac7a36cec825b0c7bd43a1d2a) --- proxy/http2/Http2ConnectionState.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc index df506c6d18..b36e5c1179 100644 --- a/proxy/http2/Http2ConnectionState.cc +++ b/proxy/http2/Http2ConnectionState.cc @@ -753,7 +753,7 @@ rcv_goaway_frame(Http2ConnectionState &cstate, const Http2Frame &frame) { Http2Goaway goaway; char buf[HTTP2_GOAWAY_LEN]; - unsigned nbytes = 0; + char *end; const Http2StreamId stream_id = frame.header().streamid; Http2StreamDebug(cstate.session, stream_id, "Received GOAWAY frame"); @@ -765,13 +765,11 @@ rcv_goaway_frame(Http2ConnectionState &cstate, const Http2Frame &frame) "goaway id non-zero"); } - while (nbytes < frame.header().length) { - unsigned read_bytes = read_rcv_buffer(buf, sizeof(buf), nbytes, frame); + end = frame.reader()->memcpy(buf, sizeof(buf), 0); - if (!http2_parse_goaway(make_iovec(buf, read_bytes), goaway)) { - return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR, - "goaway failed parse"); - } + if (!http2_parse_goaway(make_iovec(buf, end - buf), goaway)) { + return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR, + "goaway failed parse"); } Http2StreamDebug(cstate.session, stream_id, "GOAWAY: last stream id=%d, error code=%d", goaway.last_streamid,