diff --git a/proxy/http2/Http2ClientSession.cc b/proxy/http2/Http2ClientSession.cc index 6ed524d03c5..9f398a371f5 100644 --- a/proxy/http2/Http2ClientSession.cc +++ b/proxy/http2/Http2ClientSession.cc @@ -84,11 +84,6 @@ Http2ClientSession::destroy() void Http2ClientSession::free() { - if (this->_reenable_event) { - this->_reenable_event->cancel(); - this->_reenable_event = nullptr; - } - if (_vc) { _vc->do_io_close(); _vc = nullptr; @@ -105,6 +100,11 @@ Http2ClientSession::free() REMEMBER(NO_EVENT, this->recursion) Http2SsnDebug("session free"); + if (this->_reenable_event) { + this->_reenable_event->cancel(); + this->_reenable_event = nullptr; + } + // Don't free active ProxySession ink_release_assert(is_active() == false); @@ -620,8 +620,8 @@ Http2ClientSession::remember(const SourceLocation &location, int event, int reen bool Http2ClientSession::_should_do_something_else() { - // Do something else every 128 incoming frames - return (this->_n_frame_read & 0x7F) == 0; + // Do something else every 128 incoming frames if connection state isn't closed + return (this->_n_frame_read & 0x7F) == 0 && !connection_state.is_state_closed(); } sockaddr const *