# 修改 http2 googletest

* 原来仅更新了 http2 代码,未更新测试用例,造成测试用例执行时会 coredump。
This commit is contained in:
luwenpeng
2019-09-24 16:39:16 +08:00
parent afa3bed4ae
commit 5e319a1f79
2 changed files with 11 additions and 2 deletions

View File

@@ -1629,7 +1629,11 @@ nghttp2_server_submit_header(struct tfe_h2_stream *h2_stream_info, int32_t strea
stream_action = ACTION_DEFER_DATA;
goto finish;
}
// int googletest, h2_stream_info->tf_stream is NULL
if (h2_session && h2_stream_info && h2_stream_info->tf_stream) {
nghttp2_write_log(h2_session, h2_stream_info->tf_stream->str_stream_info, CONN_DIR_UPSTREAM);
}
stream_action = nghttp2_server_frame_submit_header(h2_stream_info, h2_session);
if (stream_action == ACTION_DROP_DATA){
@@ -1799,7 +1803,10 @@ nghttp2_client_submit_header(struct tfe_h2_stream *h2_stream_info, int32_t strea
req->event_cb(req, EV_HTTP_REQ_HDR, NULL, 0, req->event_cb_user);
// int googletest, h2_stream_info->tf_stream is NULL
if (h2_session && h2_stream_info && h2_stream_info->tf_stream) {
nghttp2_write_log(h2_session, h2_stream_info->tf_stream->str_stream_info, CONN_DIR_DOWNSTREAM);
}
stream_action = nghttp2_client_frame_submit_header(h2_stream_info, h2_session);
if (stream_action == ACTION_DROP_DATA){
xret = nghttp2_session_send(h2_stream_info->as_client);

View File

@@ -114,8 +114,10 @@ void UT_Parse_ReqHeaders(nghttp2_session *as_server)
/*rewrite date **/
field_name.field_id = TFE_HTTP_DATE;
field_name.field_name = "date";
xret = tfe_http_field_write(tfe_half, &field_name, NULL); // delete field_name
xret = tfe_http_field_write(tfe_half, &field_name, "201x101x");
EXPECT_EQ(xret, 0);
field_name.field_id = TFE_HTTP_DATE;
hdr_value = tfe_http_field_read((const struct tfe_http_half*)tfe_half, &field_name);
EXPECT_STREQ(hdr_value, "201x101x");