This is an automated email from the ASF dual-hosted git repository. cmcfarlen pushed a commit to branch 10.0.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 804be10d99ebba615195b3d0dd9f46e66dff7d50 Author: Brian Neradt <[email protected]> AuthorDate: Mon Jun 3 13:54:19 2024 -0500 Http2ConnectionState::restart_receiving: check for closed peer (#11410) I noticed a crash in obtaining the peer's session window in which the session's netvc was nullptr. Digging into the backtrace, this seems to have occurred because restart_receiving was called for a closed session. This patch addresses this by handling this situation. (cherry picked from commit b2e94d9df20e54f66dd744c4f9832785ab942216) --- src/proxy/http2/Http2CommonSession.cc | 3 +++ src/proxy/http2/Http2ConnectionState.cc | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/proxy/http2/Http2CommonSession.cc b/src/proxy/http2/Http2CommonSession.cc index b17da6def1..fb23db57e8 100644 --- a/src/proxy/http2/Http2CommonSession.cc +++ b/src/proxy/http2/Http2CommonSession.cc @@ -419,6 +419,9 @@ Http2CommonSession::do_process_frame_read(int event, VIO *vio, bool inside_frame bool Http2CommonSession::_should_do_something_else() { + if (this->get_proxy_session()->is_peer_closed()) { + return false; + } if (this->_interrupt_reading_frames) { this->_interrupt_reading_frames = false; return true; diff --git a/src/proxy/http2/Http2ConnectionState.cc b/src/proxy/http2/Http2ConnectionState.cc index ae739e9c3a..d4e1ac6f2d 100644 --- a/src/proxy/http2/Http2ConnectionState.cc +++ b/src/proxy/http2/Http2ConnectionState.cc @@ -1905,6 +1905,10 @@ Http2ConnectionState::restart_streams() void Http2ConnectionState::restart_receiving(Http2Stream *stream) { + if (this->session->get_proxy_session()->is_peer_closed()) { + // Cannot restart a closed connection. + return; + } // Connection level WINDOW UPDATE uint32_t const configured_session_window = this->_get_configured_receive_session_window_size(); uint32_t const min_session_window =
