diff --git a/platform/src/tcp_stream.cpp b/platform/src/tcp_stream.cpp index a6bcd15..63dc22f 100644 --- a/platform/src/tcp_stream.cpp +++ b/platform/src/tcp_stream.cpp @@ -687,6 +687,9 @@ static void __stream_bev_readcb(struct bufferevent * bev, void * arg) /* Destroy STREAM */ TFE_PROXY_STAT_INCREASE(STAT_STREAM_CLS_KILL, 1); + + /* Call plugin close when the connection is killed */ + call_plugin_close(_stream); return tfe_stream_destory(_stream); } diff --git a/plugin/protocol/http/src/http_entry.cpp b/plugin/protocol/http/src/http_entry.cpp index debc43e..0c45447 100644 --- a/plugin/protocol/http/src/http_entry.cpp +++ b/plugin/protocol/http/src/http_entry.cpp @@ -440,8 +440,13 @@ enum tfe_stream_action http_connection_entry(const struct tfe_stream * stream, e if(hs_private->kill_signal) { + /* Kill the TCP stream */ tfe_stream_kill(stream); - return ACTION_DROP_DATA; + + /* Close the session */ + __need_to_close_the_session = true; + __action = ACTION_DROP_DATA; + goto __close_the_session; } if (hf_private_in->is_upgrade || hf_private_in->is_passthrough) @@ -504,6 +509,7 @@ enum tfe_stream_action http_connection_entry(const struct tfe_stream * stream, e __need_to_close_the_session = true; } +__close_the_session: /* There is nothing for this session, close the session */ if (__need_to_close_the_session) {