diff options
| author | fengweihao <[email protected]> | 2024-01-15 15:50:58 +0800 |
|---|---|---|
| committer | fengweihao <[email protected]> | 2024-01-15 15:50:58 +0800 |
| commit | ad21a6ac3d222751ef210a5736be67d0a5112151 (patch) | |
| tree | b389601f1242d85c34f076dcdabaf966c11dd26b /plugin/business | |
| parent | b1f670c05da4a83df2ba68db62a0c1a91f614d93 (diff) | |
TSG-18596 修复Redirect-DoH策略无法命中v4.8.61-20230115
TSG-18558 Manipulation日志中,有字节数和包数均为0的日志存在
Diffstat (limited to 'plugin/business')
| -rw-r--r-- | plugin/business/doh/src/doh.cpp | 4 | ||||
| -rw-r--r-- | plugin/business/tsg-http/src/tsg_logger.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/plugin/business/doh/src/doh.cpp b/plugin/business/doh/src/doh.cpp index d14f8ab..89afd2a 100644 --- a/plugin/business/doh/src/doh.cpp +++ b/plugin/business/doh/src/doh.cpp @@ -266,7 +266,6 @@ static void doh_maat_scan(const struct tfe_stream *stream, const struct tfe_http { int hit_cnt = 0; int scan_ret = 0; - int app_id = 8006; size_t n_hit_result; struct ipaddr sapp_addr; long long p_result = 0; @@ -334,6 +333,7 @@ static void doh_maat_scan(const struct tfe_stream *stream, const struct tfe_http } } // scan appid + long long app_id = 8006; scan_ret = tfe_scan_app_id(result, ctx->scan_mid, hit_cnt, app_id, g_doh_conf->tables[TYPE_APPID].id); if(scan_ret > 0) { @@ -916,4 +916,4 @@ struct tfe_plugin doh_spec = { .on_session_begin = doh_on_begin, .on_session_data = doh_on_data, .on_session_end = doh_on_end}; -TFE_PLUGIN_REGISTER(DOH, doh_spec)
\ No newline at end of file +TFE_PLUGIN_REGISTER(DOH, doh_spec) diff --git a/plugin/business/tsg-http/src/tsg_logger.cpp b/plugin/business/tsg-http/src/tsg_logger.cpp index 8e35de2..4951a42 100644 --- a/plugin/business/tsg-http/src/tsg_logger.cpp +++ b/plugin/business/tsg-http/src/tsg_logger.cpp @@ -243,12 +243,12 @@ int proxy_send_log(struct proxy_logger* handle, const struct proxy_log* log_msg) ret = tfe_stream_info_get(log_msg->stream, INFO_FROM_DOWNSTREAM_RX_OFFSET, &c2s_byte_num, sizeof(c2s_byte_num)); if(ret != 0) { - c2s_byte_num = log_msg->c2s_byte_num; + c2s_byte_num = log_msg->c2s_byte_num == 0 ? c2s_byte_num : log_msg->c2s_byte_num; } ret = tfe_stream_info_get(log_msg->stream, INFO_FROM_UPSTREAM_RX_OFFSET, &s2c_byte_num, sizeof(s2c_byte_num)); if(ret !=0) { - s2c_byte_num = log_msg->s2c_byte_num; + s2c_byte_num = log_msg->s2c_byte_num == 0 ? s2c_byte_num : log_msg->s2c_byte_num; } cJSON_AddStringToObject(common_obj, "http_version", app_proto[http->major_version]); |
