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;