业务层适配HTTP流式写消息体的接口.

This commit is contained in:
zhengchao
2018-10-16 16:51:15 +08:00
parent 95c57fe8a5
commit f567fba70b
4 changed files with 55 additions and 65 deletions

View File

@@ -79,12 +79,12 @@ static int __write_http_half_to_line(const struct tfe_stream * stream,
* and has been call body_begin, construct the header */
if (hf_private->evbuf_body != NULL && hf_private->write_ctx == NULL)
{
ret = __write_http_half(hf_private, stream, dir);
if (unlikely(ret < 0)) return ret;
/* Alloc stream write ctx */
hf_private->write_ctx = tfe_stream_write_frag_start(stream, dir);
if (unlikely(hf_private->write_ctx == NULL)) return -1;
ret = __write_http_half(hf_private, stream, dir);
if (unlikely(ret < 0)) return ret;
}
}
else