diff options
| author | luqiuwen <[email protected]> | 2018-12-09 21:20:24 +0600 |
|---|---|---|
| committer | luqiuwen <[email protected]> | 2018-12-12 15:01:18 +0600 |
| commit | fd09f249b63fb349c61cbd8dd618c7a05ed811d9 (patch) | |
| tree | 0b1504306202bbb9140aaa29b7850a338c36e966 /plugin/protocol/http/src | |
| parent | 5ebceac0c061754d22841c68a3ae296b972c8b88 (diff) | |
增加HTTP-Kill/TCP-Kill功能
Diffstat (limited to 'plugin/protocol/http/src')
| -rw-r--r-- | plugin/protocol/http/src/http_entry.cpp | 6 | ||||
| -rw-r--r-- | plugin/protocol/http/src/http_half.cpp | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/plugin/protocol/http/src/http_entry.cpp b/plugin/protocol/http/src/http_entry.cpp index 43f0b92..108a174 100644 --- a/plugin/protocol/http/src/http_entry.cpp +++ b/plugin/protocol/http/src/http_entry.cpp @@ -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); diff --git a/plugin/protocol/http/src/http_half.cpp b/plugin/protocol/http/src/http_half.cpp index 424aceb..f37314e 100644 --- a/plugin/protocol/http/src/http_half.cpp +++ b/plugin/protocol/http/src/http_half.cpp @@ -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, |
