summaryrefslogtreecommitdiff
path: root/plugin/protocol/http2/src/http2_stream.cpp
diff options
context:
space:
mode:
authorfengweihao <[email protected]>2019-12-05 19:04:04 +0800
committerfengweihao <[email protected]>2019-12-05 19:04:04 +0800
commit7476f84fa1e4b806d5b3be71ed88cf91f39eb0bc (patch)
tree273e90c5a0f08fc61ce4c6985bc4e4b323317403 /plugin/protocol/http2/src/http2_stream.cpp
parent70da6223932d305a536f0405ca1a603535167128 (diff)
TSG-376 修复Proxy Event Logs中Request Line、Response Line显示为空,Stream Trace Id显示为0
1)修复重定向命中URL+请求头,域名输入错误页面本身重定向失败问题
Diffstat (limited to 'plugin/protocol/http2/src/http2_stream.cpp')
-rw-r--r--plugin/protocol/http2/src/http2_stream.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/plugin/protocol/http2/src/http2_stream.cpp b/plugin/protocol/http2/src/http2_stream.cpp
index 8f5446a..9a2ca24 100644
--- a/plugin/protocol/http2/src/http2_stream.cpp
+++ b/plugin/protocol/http2/src/http2_stream.cpp
@@ -731,6 +731,13 @@ nghttp2_frame_submit_built_resp(struct tfe_h2_stream *h2_stream_info,
if (h2_header->nvlen <= 0)
return ACTION_FORWARD_DATA;
+ char value[128] = {0}; struct http_field_name field;
+ field.field_id = TFE_HTTP_UNKNOWN_FIELD;
+ field.field_name = ":status";
+ snprintf(value, sizeof(value), "%d", pangu_resp->method_or_status);
+ tfe_http_nonstd_field_write(&pangu_resp->half_public, ":status", NULL);
+ tfe_h2_header_add_field(h2_header, &field, (const char *)value, 0);
+
struct tfe_h2_payload *body = &pangu_resp->h2_payload;
body->flags |= NGHTTP2_FLAG_END_STREAM;
char str_sz_evbuf_body[TFE_STRING_MAX];
@@ -1507,11 +1514,6 @@ nghttp2_submit_built_response(struct tfe_h2_stream *h2_stream_info,
snprintf(value, sizeof(value), "tfe/%s", tfe_version());
tfe_h2_header_add_field(&resp->header, &field, (const char *)value, 0);
- field.field_id = TFE_HTTP_UNKNOWN_FIELD;
- field.field_name = ":status";
- snprintf(value, sizeof(value), "%d", resp->method_or_status);
- tfe_h2_header_add_field(&resp->header, &field, (const char *)value, 0);
-
stream_action = nghttp2_frame_submit_built_resp(h2_stream_info, h2_session);
if (stream_action == ACTION_DROP_DATA)
{
@@ -1544,7 +1546,8 @@ nghttp2_server_frame_submit_header(struct tfe_h2_stream *h2_stream_info,
{
stream_action = nghttp2_submit_built_response(h2_stream_info, h2_session);
}
- else{
+ else
+ {
stream_action = (enum tfe_stream_action)ACTION_USER_DATA;
}
return stream_action;