增加HTTP重定向业务发送应答体的功能支持,调通发送403, 404等告警页面的功能。

This commit is contained in:
Lu Qiuwen
2018-09-25 11:15:00 +08:00
parent c2f0bde211
commit d2e4ce94c2
2 changed files with 35 additions and 16 deletions

View File

@@ -422,7 +422,9 @@ const char * hf_ops_field_iterate(const struct tfe_http_half * half, void ** ite
int hf_ops_append_body(struct tfe_http_half * half, char * buff, size_t size, int flag)
{
return 0;
struct http_half_private * hf_private = to_hf_private(half);
if (hf_private->evbuf_body == NULL) { hf_private->evbuf_body = evbuffer_new(); }
return evbuffer_add(hf_private->evbuf_body, buff, size);
}
void hf_private_destory(struct http_half_private * hf_private)
@@ -651,6 +653,13 @@ void hf_private_construct(struct http_half_private * hf_private)
/* delimitor between header and body */
evbuffer_add_printf(hf_private->evbuf_raw, "\r\n");
/* add body */
if (hf_private->evbuf_body)
{
evbuffer_add_buffer(hf_private->evbuf_raw, hf_private->evbuf_body);
}
return;
}
struct http_session_private * hs_private_create(struct http_connection_private * hc_private,