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
12 changes: 12 additions & 0 deletions proxy/http/Http1ClientSession.cc
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ Http1ClientSession::do_io_close(int alerrno)
_reader->consume(_reader->read_avail());
} else {
read_state = HCS_CLOSED;
SET_HANDLER(&Http1ClientSession::state_wait_for_sm_shutdown);
ka_vio = _vc->do_io_read(this, INT64_MAX, read_buffer);
HttpSsnDebug("[%" PRId64 "] session closed", con_id);
HTTP_SUM_DYN_STAT(http_transactions_per_client_con, transact_count);
HTTP_DECREMENT_DYN_STAT(http_current_client_connections_stat);
Expand All @@ -274,6 +276,16 @@ Http1ClientSession::do_io_close(int alerrno)
}
}

int
Http1ClientSession::state_wait_for_sm_shutdown(int event, void *data)
{
STATE_ENTER(&Http1ClientSession::state_wait_for_sm_shutdown, event, data);
ink_assert(read_state == HCS_CLOSED);

// Just eat IO events until the state machine has finished
return 0;
}

int
Http1ClientSession::state_wait_for_close(int event, void *data)
{
Expand Down
10 changes: 5 additions & 5 deletions proxy/http/Http1ClientSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class Http1ClientSession : public ProxySession
int state_keep_alive(int event, void *data);
int state_slave_keep_alive(int event, void *data);
int state_wait_for_close(int event, void *data);
int state_wait_for_sm_shutdown(int event, void *data);

enum C_Read_State {
HCS_INIT,
Expand All @@ -96,11 +97,10 @@ class Http1ClientSession : public ProxySession
HCS_CLOSED,
};

NetVConnection *client_vc = nullptr;
int magic = HTTP_SS_MAGIC_DEAD;
int transact_count = 0;
bool half_close = false;
bool conn_decrease = false;
int magic = HTTP_SS_MAGIC_DEAD;
int transact_count = 0;
bool half_close = false;
bool conn_decrease = false;

MIOBuffer *read_buffer = nullptr;
IOBufferReader *_reader = nullptr;
Expand Down
5 changes: 5 additions & 0 deletions proxy/http/HttpSM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3269,6 +3269,11 @@ HttpSM::tunnel_handler_ua(int event, HttpTunnelConsumer *c)
server_session->get_netvc()->set_active_timeout(HRTIME_SECONDS(t_state.txn_conf->background_fill_active_timeout));
}

// Even with the background fill, the client side should go down
c->write_vio = nullptr;
c->vc->do_io_close(EHTTP_ERROR);
c->alive = false;

} else {
// No background fill
p = c->producer;
Expand Down