Close #33 增加HTTP Upgrade透明转发的功能

This commit is contained in:
Lu Qiuwen
2018-10-24 15:40:26 +08:00
parent c53641bc27
commit 62b8089166
4 changed files with 28 additions and 5 deletions

View File

@@ -436,8 +436,7 @@ enum tfe_stream_action __http_connection_entry_on_response(const struct tfe_stre
hf_private_set_session(hf_private_resp_in, hs_private);
/* Closure, catch stream, session and thread_id */
struct user_event_dispatch_closure * __closure = ALLOC(
struct user_event_dispatch_closure, 1);
struct user_event_dispatch_closure * __closure = ALLOC(struct user_event_dispatch_closure, 1);
__closure->thread_id = thread_id;
__closure->stream = stream;
__closure->session = to_hs_public(hs_private);
@@ -478,6 +477,13 @@ enum tfe_stream_action __http_connection_entry_on_response(const struct tfe_stre
goto __errout;
}
/* Upgrade, passthrough the connection and close this session */
if (hf_private_resp_in->is_upgrade)
{
tfe_stream_detach(stream);
hf_private_resp_in->stream_action = ACTION_FORWARD_DATA;
}
hf_private_resp_user = hs_private->hf_private_resp_user;
if (hf_private_resp_user != NULL)
{