1.修改nghttp2库中关于ping包处理流程

2.修改调试log信息等级为debug
3.增加http2关于缓存代码控制宏变量
4.测试存在的几个bug修复
This commit is contained in:
fengweihao
2019-04-30 16:41:01 +08:00
committed by zhengchao
parent 77d2e3fb53
commit 6ac97cce6b
5 changed files with 374 additions and 211 deletions

View File

@@ -120,6 +120,30 @@ http2_stream_open(const struct tfe_stream *stream, unsigned int thread_id,
return 0;
}
/*setting frame: 00 00 12 04 00 00 00 00 00 00 03 00 00 00 80 00 04 7f ff ff ff 00 05 00 ff ff ff 00 00 04 08 00
00 00 00 00 7f ff 00 00 ***/
static int
search_up_stream_data(const unsigned char * data, size_t len)
{
uint8_t indetifier = 0;
if (get_u_int8_t(data, 3) != 0x4)
return 0;
indetifier = get_u_int8_t(data, 10);
if (indetifier < NGHTTP2_SETTINGS_HEADER_TABLE_SIZE ||
indetifier > NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE)
return 0;
indetifier = get_u_int8_t(data, 16);
if (indetifier < NGHTTP2_SETTINGS_HEADER_TABLE_SIZE ||
indetifier > NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE)
return 0;
return 1;
}
static enum tfe_stream_action
http2_stream_data(const struct tfe_stream * stream, unsigned int thread_id,
enum tfe_conn_dir dir, const unsigned char * data, size_t len, void ** pme)
@@ -134,13 +158,7 @@ http2_stream_data(const struct tfe_stream * stream, unsigned int thread_id,
tfe_stream_action_set_opt(stream, ACTION_OPT_DEFER_BYTES, (void *) &defer_bytes, sizeof(defer_bytes));
return ACTION_DEFER_DATA;
}
/*setting frame: 00 00 12 04 00 00 00 00 00 00 03 00 00 00 80 00 04 7f ff ff ff 00 05 00 ff ff ff 00 00 04 08 00
00 00 00 00 7f ff 00 00 ***/
if (get_u_int8_t(data, 3) == 0x4
&& ((get_u_int8_t(data, 9) == 0x00 && get_u_int8_t(data, 10) == 0x03)
|| (get_u_int8_t(data, 15) == 0x00 && get_u_int8_t(data, 16) == 0x04)
|| (get_u_int8_t(data, 21) == 0x00 && get_u_int8_t(data, 22) == 0x05))){
if (search_up_stream_data(data, len)){
}else{
goto finish;
}