1.修改HTTP2命中block规则后,页面无法显示问题

2.上次漏提代码对ex_data释放接口
This commit is contained in:
fengweihao
2019-05-28 17:38:19 +08:00
parent f106facd7b
commit 3339ffd533
2 changed files with 62 additions and 18 deletions

View File

@@ -863,8 +863,11 @@ nghttp2_submit_frame_priority(struct tfe_session_info_t *session_info,const nght
dir, nghttp2_strerror(xret));
}
finish:
#ifdef TFE_LOG_HTTP2
TFE_LOG_DEBUG(logger()->handle, "%s, %d, submit priority, stream_id:%d, action:%d", session_info->tf_stream->str_stream_info,
dir, frame->hd.stream_id, session_info->stream_action);
#endif
session_info->stream_action = stream_action;
return 0;
}
@@ -895,8 +898,11 @@ nghttp2_submit_frame_rst_stream(struct tfe_session_info_t *session_info,const ng
}
finish:
session_info->stream_action = stream_action;
#ifdef TFE_LOG_HTTP2
TFE_LOG_DEBUG(logger()->handle, "%s, %d, submit rst stream, stream_id:%d, action:%d, error_code = %d", session_info->tf_stream->str_stream_info,
dir, frame->hd.stream_id, session_info->stream_action, rst_stream->error_code);
#endif
return 0;
}
@@ -937,9 +943,12 @@ nghttp2_submit_frame_settings(struct tfe_session_info_t *session_info,const nght
}
finish:
session_info->stream_action = stream_action;
#ifdef TFE_LOG_HTTP2
TFE_LOG_DEBUG(logger()->handle, "%s, %d, submit setting, stream_id:%d, action:%d", session_info->tf_stream->str_stream_info,
dir, frame->hd.stream_id, session_info->stream_action);
return 0;
#endif
return 0;
}
static int
@@ -968,8 +977,11 @@ nghttp2_submit_frame_ping(struct tfe_session_info_t *session_info,const nghttp2_
}
finish:
session_info->stream_action = stream_action;
#ifdef TFE_LOG_HTTP2
TFE_LOG_DEBUG(logger()->handle, "%s, %d, submit ping, stream_id:%d, action:%d", session_info->tf_stream->str_stream_info,
dir, frame->hd.stream_id, session_info->stream_action);
#endif
return 0;
}
@@ -1107,8 +1119,11 @@ nghttp2_submit_frame_window_update(struct tfe_session_info_t *session_info,const
}
finish:
session_info->stream_action = stream_action;
#ifdef TFE_LOG_HTTP2
TFE_LOG_DEBUG(logger()->handle, "%s, %d, submit window update, stream_id:%d, action:%d", session_info->tf_stream->str_stream_info,
dir, frame->hd.stream_id, session_info->stream_action);
#endif
return 0;
}
@@ -1161,10 +1176,6 @@ nghttp2_submit_end_data(struct tfe_session_info_t *session_info,
struct http2_half_private *resp = h2_stream->resp;
if (resp->body_state == MANAGE_STAGE_INIT){
nghttp2_submit_end_header(session_info, h2_stream);
}
if (resp->body_state != MANAGE_STAGE_INIT){
if (resp->event_cb) {
resp->event_cb(resp, EV_HTTP_RESP_BODY_END, NULL, 0,
@@ -1188,9 +1199,11 @@ nghttp2_submit_end_data(struct tfe_session_info_t *session_info,
TFE_LOG_ERROR(logger()->handle, "Fatal upstream send error: %s\n",nghttp2_strerror(xret));
}
}
#ifdef TFE_LOG_HTTP2
TFE_LOG_DEBUG(logger()->handle, "%s, 1, End of stream submit, stream_id:%d, action:%d", session_info->tf_stream->str_stream_info,
h2_stream->stream_id, session_info->stream_action);
#endif
if (stream_action == ACTION_USER_DATA)
stream_action = ACTION_DROP_DATA;
session_info->stream_action = stream_action;
@@ -1354,8 +1367,11 @@ nghttp2_submit_frame_push_promise(struct tfe_session_info_t *session_info,const
}
session_info->stream_action = stream_action;
finish:
#ifdef TFE_LOG_HTTP2
TFE_LOG_DEBUG(logger()->handle, "%s, %d, submit push promise, stream_id:%d, action:%d", session_info->tf_stream->str_stream_info,
dir, frame->hd.stream_id, session_info->stream_action);
#endif
return 0;
}
@@ -1682,7 +1698,7 @@ tfe_submit_response(struct tfe_session_info_t *session_info,
stream_action = nghttp2_server_frame_submit_response(session_info, h2_stream);
if (stream_action == ACTION_DROP_DATA){
xret = nghttp2_session_send(session_info->as_client);
xret = nghttp2_session_send(session_info->as_server);
if (xret != 0) {
stream_action = ACTION_FORWARD_DATA;
TFE_LOG_ERROR(logger()->handle, "Fatal downstream send error: %s\n",
@@ -1837,13 +1853,17 @@ nghttp2_submit_frame_header(struct tfe_session_info_t *session_info,const nghttp
if (frame->hd.flags & NGHTTP2_FLAG_END_HEADERS){
if (dir == CONN_DIR_UPSTREAM){
xret = nghttp2_server_submit_header(session_info, frame->hd.stream_id);
#ifdef TFE_LOG_HTTP2
TFE_LOG_DEBUG(logger()->handle, "%s, %d, submit response header, stream_id:%d, action:%d", session_info->tf_stream->str_stream_info,
dir, frame->hd.stream_id, session_info->stream_action);
#endif
}
if (dir == CONN_DIR_DOWNSTREAM){
xret = nghttp2_client_submit_header(session_info, frame->hd.stream_id);
#ifdef TFE_LOG_HTTP2
TFE_LOG_DEBUG(logger()->handle, "%s, %d, submit request header, stream_id:%d, action:%d", session_info->tf_stream->str_stream_info,
dir, frame->hd.stream_id, session_info->stream_action);
#endif
}
}
return xret;
@@ -2111,11 +2131,14 @@ nghttp2_client_on_data_chunk_recv(nghttp2_session *session, uint8_t flags,
xret = nghttp2_session_send(session_info->as_server);
if (xret != 0) {
stream_action = ACTION_FORWARD_DATA;
TFE_LOG_ERROR(logger()->handle, "Fatal upstream send error: %s\n",nghttp2_strerror(xret));
TFE_LOG_ERROR(logger()->handle, "Fatal upstream(%d) send error: %s\n",stream_id, nghttp2_strerror(xret));
}
}
#ifdef TFE_LOG_HTTP2
TFE_LOG_DEBUG(logger()->handle, "%s, 1, submit data %d, stream_id:%d, action:%d", session_info->tf_stream->str_stream_info,
(int)input_len, stream_id, stream_action);
#endif
if (stream_action == ACTION_USER_DATA)
stream_action = ACTION_DROP_DATA;
session_info->stream_action = stream_action;
@@ -2402,8 +2425,11 @@ nghttp2_server_on_data_chunk_recv(nghttp2_session *session, uint8_t flags,
TFE_LOG_ERROR(logger()->handle, "Fatal upstream send error: %s\n",nghttp2_strerror(xret));
}
}
#ifdef TFE_LOG_HTTP2
TFE_LOG_INFO(logger()->handle, "%s, %d, submit data %d, stream_id:%d, action:%d", session_info->tf_stream->str_stream_info,
0, (int)input_len, stream_id, session_info->stream_action);
#endif
if (stream_action == ACTION_USER_DATA)
stream_action = ACTION_DROP_DATA;
session_info->stream_action = stream_action;