Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion proxy/http/Http1ClientSession.cc
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ Http1ClientSession::do_io_close(int alerrno)
if (transact_count == released_transactions) {
half_close = false;
}

// Clean up the write VIO in case of inactivity timeout
this->do_io_write(nullptr, 0, nullptr);

if (half_close && this->trans.get_sm()) {
read_state = HCS_HALF_CLOSED;
SET_HANDLER(&Http1ClientSession::state_wait_for_close);
Expand Down Expand Up @@ -286,7 +290,6 @@ Http1ClientSession::do_io_close(int alerrno)
HTTP_SUM_DYN_STAT(http_transactions_per_client_con, transact_count);
HTTP_DECREMENT_DYN_STAT(http_current_client_connections_stat);
conn_decrease = false;
// the netvc will be closed in the session free
}
if (transact_count == released_transactions) {
this->destroy();
Expand All @@ -313,6 +316,10 @@ Http1ClientSession::state_wait_for_close(int event, void *data)
case VC_EVENT_INACTIVITY_TIMEOUT:
half_close = false;
this->do_io_close();
if (client_vc != nullptr) {
client_vc->do_io_close();
client_vc = nullptr;
}
break;
case VC_EVENT_READ_READY:
// Drain any data read
Expand Down Expand Up @@ -389,6 +396,10 @@ Http1ClientSession::state_keep_alive(int event, void *data)

case VC_EVENT_EOS:
this->do_io_close();
if (client_vc != nullptr) {
client_vc->do_io_close();
client_vc = nullptr;
}
break;

case VC_EVENT_READ_COMPLETE:
Expand Down
9 changes: 7 additions & 2 deletions proxy/http2/Http2ClientSession.cc
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,15 @@ Http2ClientSession::do_io_close(int alerrno)
ink_assert(this->mutex->thread_holding == this_ethread());
send_connection_event(&this->connection_state, HTTP2_SESSION_EVENT_FINI, this);

// client_vc will be closed in Http2ClientSession::free

{
SCOPED_MUTEX_LOCK(lock, this->connection_state.mutex, this_ethread());
this->connection_state.release_stream();
}

this->clear_session_active();

// Clean up the write VIO in case of inactivity timeout
this->do_io_write(nullptr, 0, nullptr);
}

void
Expand Down Expand Up @@ -375,6 +376,10 @@ Http2ClientSession::main_event_handler(int event, void *edata)
case VC_EVENT_EOS:
this->set_dying_event(event);
this->do_io_close();
if (client_vc != nullptr) {
client_vc->do_io_close();
client_vc = nullptr;
}
retval = 0;
break;

Expand Down