diff --git a/proxy/ProxyClientSession.cc b/proxy/ProxyClientSession.cc index c4fba5bfef5..42f4f3bb1c1 100644 --- a/proxy/ProxyClientSession.cc +++ b/proxy/ProxyClientSession.cc @@ -198,10 +198,6 @@ ProxyClientSession::handle_api_return(int event) } break; case TS_HTTP_SSN_CLOSE_HOOK: { - NetVConnection *vc = this->get_netvc(); - if (vc) { - vc->do_io_close(); - } free(); // You can now clean things up break; } diff --git a/proxy/http/Http1ClientSession.cc b/proxy/http/Http1ClientSession.cc index 31ed45dec0a..4865886a2c7 100644 --- a/proxy/http/Http1ClientSession.cc +++ b/proxy/http/Http1ClientSession.cc @@ -135,6 +135,11 @@ Http1ClientSession::free() // Free the transaction resources this->trans.super_type::destroy(); + if (client_vc) { + client_vc->do_io_close(); + client_vc = nullptr; + } + super::free(); THREAD_FREE(this, http1ClientSessionAllocator, this_thread()); }