From d55f2e36d369e3ea5f52d199a811aaca49cc2280 Mon Sep 17 00:00:00 2001 From: luwenpeng Date: Wed, 15 Jul 2020 14:12:52 +0800 Subject: [PATCH] =?UTF-8?q?DOH=20=E4=BF=AE=E5=A4=8D=E6=BD=9C=E5=9C=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=9Amaat=20=E5=91=BD=E4=B8=AD=E7=AD=96?= =?UTF-8?q?=E7=95=A5=E6=95=B0=E8=BF=87=E5=A4=9A=E5=AF=BC=E8=87=B4=E6=95=B0?= =?UTF-8?q?=E7=BB=84=E8=B6=8A=E7=95=8C=20=09=E7=B1=BB=E4=BC=BC=E4=BA=8E=20?= =?UTF-8?q?Pangu=20(TSG-2535=20Main=20Board=E7=BB=9F=E8=AE=A1=E4=B8=AD?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E8=B4=9F=E6=95=B0Policy=20Id=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE)=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/business/doh/src/doh.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugin/business/doh/src/doh.cpp b/plugin/business/doh/src/doh.cpp index fbd177c..259be99 100644 --- a/plugin/business/doh/src/doh.cpp +++ b/plugin/business/doh/src/doh.cpp @@ -1,6 +1,6 @@ #include "logger.h" -#define MAX_SCAN_RESULT 128 +#define MAX_SCAN_RESULT 16 #define DOH_CTX_MAGIC_NUM 20200601 #define REQ_METHOD_IS_GET(method) ((method == TFE_HTTP_METHOD_GET) ? 1 : 0) @@ -182,7 +182,7 @@ static struct Maat_rule_t *doh_fetch_rule(Maat_rule_t *result, int result_num) int i = 0; Maat_rule_t *p_result = NULL; - for (i = 0; i < result_num; i++) + for (i = 0; i < result_num && i < MAX_SCAN_RESULT; i++) { if (p_result == NULL) { @@ -748,6 +748,7 @@ int doh_on_init(struct tfe_proxy *proxy) TFE_LOG_INFO(NULL, "Doh disabled."); goto success; } + TFE_LOG_INFO(NULL, "Doh enabled."); g_doh_conf->thread_num = tfe_proxy_get_work_thread_count(); g_doh_conf->local_logger = MESA_create_runtime_log_handle("./log/doh_pxy.log", g_doh_conf->local_level); @@ -771,6 +772,7 @@ int doh_on_init(struct tfe_proxy *proxy) TFE_LOG_ERROR(NULL, "Doh init maat failed."); goto error; } + TFE_LOG_INFO(g_doh_conf->local_logger, "Doh init success."); success: return 0;