diff options
| author | yangwei <[email protected]> | 2022-07-29 11:18:18 +0800 |
|---|---|---|
| committer | yangwei <[email protected]> | 2022-07-29 11:18:18 +0800 |
| commit | e7a14f4a8edb5671d9c0c48255493c807ff2c743 (patch) | |
| tree | 5f8c8f5ff2d04709b1bf830fa3114721cf663809 /src | |
| parent | 274614cde4d166fb1209e51432609377f48ee7e8 (diff) | |
🐞 fix(http_doWithACompleteRegion): MESA_htable_search前判断key长度,避免告警
Diffstat (limited to 'src')
| -rw-r--r-- | src/HTTP_Message_Region.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/HTTP_Message_Region.c b/src/HTTP_Message_Region.c index 4fa5aeb..b1f2022 100644 --- a/src/HTTP_Message_Region.c +++ b/src/HTTP_Message_Region.c @@ -339,7 +339,8 @@ uchar http_doWithConnection(http_parser_t* a_http, http_stream *a_http_stream, c } else if(0==strncasecmp((char*)value,"close",sizeof("close")-1)) { - FLAG_SET(a_http->flag, HTTP_FLAG_CONNECT_CLOSE);
+ FLAG_SET(a_http->flag, HTTP_FLAG_CONNECT_CLOSE); + } a_http->session.buf = value; a_http->session.buflen = valuelen; @@ -662,7 +663,15 @@ uchar http_doWithACompleteRegion(http_parser_t *cur_http_node, http_stream *a_ht { memcpy(copy_region_name, region_name, reg_name_len); stringA_to_stringa(copy_region_name, reg_name_len); - region_id_hash = (int*)MESA_htable_search(g_http_prog_para.region_hash, (const uchar*)copy_region_name, reg_name_len); + if(strlen(copy_region_name) > 0 && reg_name_len > 0) + { + region_id_hash = (int*)MESA_htable_search(g_http_prog_para.region_hash, (const uchar*)copy_region_name, reg_name_len); + } + else + { + MESA_handle_runtime_log(g_http_prog_para.http_log_handle, RLOG_LV_FATAL, HTTP_PLUGIN_NAME, "region name invalid, addr:%s", + printaddr(&a_tcp->addr,thread_seq)); + } } /*expand region*/ |
