增加HTTP-Kill/TCP-Kill功能
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user