diff --git a/plugin/protocol/http/src/http_entry.cpp b/plugin/protocol/http/src/http_entry.cpp index 187af9c..aa9c82e 100644 --- a/plugin/protocol/http/src/http_entry.cpp +++ b/plugin/protocol/http/src/http_entry.cpp @@ -61,9 +61,17 @@ static int __write_http_half(struct http_half_private * hf_private, unsigned char * __to_write = evbuffer_pullup(hf_private->evbuf_raw, __to_write_len); /* Write the data to stream, UPSTREAM is the incoming direction for response */ - int ret = tfe_stream_write(stream, dir, __to_write, __to_write_len); - if (unlikely(ret < 0)) { assert(0); } + int ret = 0; + if (hf_private->write_ctx) + { + ret = tfe_stream_write_frag(hf_private->write_ctx, __to_write, __to_write_len); + } + else + { + ret = tfe_stream_write(stream, dir, __to_write, __to_write_len); + } + if (unlikely(ret < 0)) { assert(0); } evbuffer_drain(hf_private->evbuf_raw, __to_write_len); return ret; } @@ -327,6 +335,11 @@ enum tfe_stream_action __http_connection_entry_on_response(const struct tfe_stre hf_private_destory(hf_private_resp_user); hs_private->hf_private_resp_user = NULL; } + + if (hf_private_resp_in->stream_action == ACTION_DEFER_DATA) + { + hf_private_resp_in->stream_action = ACTION_DROP_DATA; + } } __stream_action = hf_private_resp_in->stream_action;