diff --git a/proxy/PoolableSession.h b/proxy/PoolableSession.h index 76946ef34ce..802ddb3eaa1 100644 --- a/proxy/PoolableSession.h +++ b/proxy/PoolableSession.h @@ -83,6 +83,8 @@ class PoolableSession : public ProxySession void set_netvc(NetVConnection *newvc); + virtual IOBufferReader *get_reader() = 0; + private: // Sessions become if authentication headers // are sent over them diff --git a/proxy/http/Http1ClientSession.cc b/proxy/http/Http1ClientSession.cc index 9670dee2d4a..d070bd9462f 100644 --- a/proxy/http/Http1ClientSession.cc +++ b/proxy/http/Http1ClientSession.cc @@ -468,7 +468,7 @@ Http1ClientSession::attach_server_session(PoolableSession *ssession, bool transa // have it call the client session back. This IO also prevent // the server net conneciton from calling back a dead sm SET_HANDLER(&Http1ClientSession::state_keep_alive); - slave_ka_vio = ssession->do_io_read(this, 0, nullptr); + slave_ka_vio = ssession->do_io_read(this, INT64_MAX, ssession->get_reader()->mbuf); ink_assert(slave_ka_vio != ka_vio); // Transfer control of the write side as well diff --git a/proxy/http/Http1ServerSession.h b/proxy/http/Http1ServerSession.h index 0de92de92a2..c74cc80d7fa 100644 --- a/proxy/http/Http1ServerSession.h +++ b/proxy/http/Http1ServerSession.h @@ -76,7 +76,7 @@ class Http1ServerSession : public PoolableSession void start() override; void enable_outbound_connection_tracking(OutboundConnTrack::Group *group); - IOBufferReader *get_reader(); + IOBufferReader *get_reader() override; void attach_hostname(const char *hostname); IpEndpoint const &get_server_ip() const; diff --git a/proxy/http/HttpSessionManager.cc b/proxy/http/HttpSessionManager.cc index 4f7fabbe3de..462225969b5 100644 --- a/proxy/http/HttpSessionManager.cc +++ b/proxy/http/HttpSessionManager.cc @@ -206,7 +206,9 @@ ServerSessionPool::releaseSession(PoolableSession *ss) // if it closes on us. We will get called back in the // continuation for this bucket, ensuring we have the lock // to remove the connection from our lists - ss->do_io_read(this, 0, nullptr); + // Actually need to have a buffer here, otherwise the vc is + // disabled + ss->do_io_read(this, INT64_MAX, ss->get_reader()->mbuf); // Transfer control of the write side as well ss->do_io_write(this, 0, nullptr);