Skip to content

Commit

Permalink
Fix so EOS are delivered to sessions in the pool (#7828)
Browse files Browse the repository at this point in the history
  • Loading branch information
shinrich authored May 14, 2021
1 parent 73d179a commit 9a7742a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions proxy/PoolableSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion proxy/http/Http1ClientSession.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion proxy/http/Http1ServerSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 3 additions & 1 deletion proxy/http/HttpSessionManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9a7742a

Please sign in to comment.