diff --git a/plugin/protocol/http/src/http_entry.cpp b/plugin/protocol/http/src/http_entry.cpp index eb2ac78..3789da8 100644 --- a/plugin/protocol/http/src/http_entry.cpp +++ b/plugin/protocol/http/src/http_entry.cpp @@ -195,6 +195,13 @@ enum tfe_stream_action __http_connection_entry_on_response(const struct tfe_stre /* Set callback, this callback used to raise business event */ hf_private_set_callback(hf_private_resp_in, __user_event_dispatch, __closure, free); + + /* Setup user's action */ + if (hs_private->hf_private_resp_user != NULL) + { + hf_private_resp_in->is_user_stream_action_set = true; + hf_private_resp_in->user_stream_action = ACTION_DROP_DATA; + } } /* Parse the content, the data which in defered state has been ignored. */ diff --git a/plugin/protocol/http/src/http_half.cpp b/plugin/protocol/http/src/http_half.cpp index c9b5f67..6820d8d 100644 --- a/plugin/protocol/http/src/http_half.cpp +++ b/plugin/protocol/http/src/http_half.cpp @@ -484,6 +484,8 @@ struct http_half_private * hf_private_create(tfe_http_direction ht_dir, short ma assert(ht_dir == TFE_HTTP_REQUEST || ht_dir == TFE_HTTP_RESPONSE); /* PUBLIC */ + hf_private->hf_public.major_version = major; + hf_private->hf_public.minor_version = minor; hf_private->hf_public.direction = ht_dir; hf_private->hf_public.ops = &__http_half_ops; @@ -502,6 +504,8 @@ struct http_half_private * hf_private_create(tfe_http_direction ht_dir, short ma hf_private->parse_settings = &__http_half_parse_setting; hf_private->parse_object->data = hf_private; + hf_private->major = major; + hf_private->minor = minor; TAILQ_INIT(&hf_private->header_list); return hf_private; @@ -659,9 +663,6 @@ void __construct_request_line(struct http_half_private * hf_private) __str_method = ""; } - hf_private->major = 1; - hf_private->minor = 1; - evbuffer_add_printf(hf_private->evbuf_raw, "%s %s HTTP/%d.%d\r\n", __str_method, hf_private->url_storage, hf_private->major, hf_private->minor); } @@ -675,9 +676,6 @@ void __construct_response_line(struct http_half_private * hf_private) __str_resp_code = ""; } - hf_private->major = 1; - hf_private->minor = 1; - evbuffer_add_printf(hf_private->evbuf_raw, "HTTP/%d.%d %d %s\r\n", hf_private->major, hf_private->minor, __resp_code, __str_resp_code); }