增加HTTP-Kill/TCP-Kill功能

This commit is contained in:
luqiuwen
2018-12-09 21:20:24 +06:00
parent 5ebceac0c0
commit fd09f249b6
8 changed files with 52 additions and 0 deletions

View File

@@ -446,6 +446,12 @@ enum tfe_stream_action http_connection_entry(const struct tfe_stream * stream, e
goto __passthrough;
}
if(hs_private->kill_signal)
{
tfe_stream_kill(stream);
return ACTION_DROP_DATA;
}
ret = (dir == CONN_DIR_DOWNSTREAM) ?
__on_request_handle_user_req_or_resp(stream, hs_private, hf_private_in, __need_to_close_the_session) :
__on_response_handle_user_req_or_resp(stream, hs_private, hf_private_in, __need_to_close_the_session);

View File

@@ -900,6 +900,12 @@ void hs_ops_detach(const struct tfe_http_session * session)
void hs_ops_drop(struct tfe_http_session * session)
{}
void hs_ops_kill(struct tfe_http_session * session)
{
struct http_session_private * hs_private = to_hs_private((struct tfe_http_session *) session);
hs_private->kill_signal = true;
}
void hs_ops_suspend(struct tfe_http_session * session)
{
struct http_session_private * hs_private = to_hs_private(session);
@@ -1028,6 +1034,7 @@ struct tfe_http_session_ops __http_session_ops =
.ops_drop = hs_ops_drop,
.ops_suspend = hs_ops_suspend,
.ops_resume = hs_ops_resume,
.ops_kill = hs_ops_kill,
.ops_request_set = hs_ops_request_set,
.ops_response_set = hs_ops_response_set,
.ops_request_create = hs_ops_request_create,