From 412d6f8944c521e3dfbeea0d749ac960018d6724 Mon Sep 17 00:00:00 2001 From: fengweihao Date: Thu, 11 May 2023 16:48:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=AD=A3=E5=88=99=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E7=94=B1=E4=BA=8E=E7=AC=94=E8=AF=AF=E9=80=A0=E6=88=90?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=9A=84=E6=AD=A3=E5=88=99=E6=95=B0=E7=BB=84?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platform/src/verify_policy.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/platform/src/verify_policy.cpp b/platform/src/verify_policy.cpp index dbf3da6..ff02bf0 100644 --- a/platform/src/verify_policy.cpp +++ b/platform/src/verify_policy.cpp @@ -340,9 +340,8 @@ enum verify_type get_verify_type(cJSON* data_json) static int get_query_result_regex(cJSON *verifylist_array_item, cJSON *data_obj) { int cur_id=0, i=0, is_valid[32]={0}; - cJSON *regexstr_obj[32]; + cJSON *regexstr_obj[32],*attributes=NULL; cJSON *item = NULL, *subchild = NULL; - cJSON *attributes=NULL; attributes = cJSON_GetObjectItem(verifylist_array_item, "verifyRegex"); if(attributes==NULL || attributes->type != cJSON_Array) @@ -364,7 +363,7 @@ static int get_query_result_regex(cJSON *verifylist_array_item, cJSON *data_obj) cJSON *verify_regex_obj=NULL; cJSON *verifyRegex=cJSON_CreateArray(); - cJSON_AddItemToObject(data_obj, "attributes", verifyRegex); + cJSON_AddItemToObject(data_obj, "verifyRegex", verifyRegex); for (i = 0; i < cur_id; i++) { verify_regex_obj=cJSON_CreateObject(); @@ -494,6 +493,7 @@ cJSON *get_query_from_request(const char *data, int thread_id) cJSON_AddItemToObject(policy_obj, "data", data_obj); int verify_type=get_verify_type(data_json); + mesa_runtime_log(RLOG_LV_DEBUG, " [I] verifyType= %d", verify_type); cJSON *item = NULL, *subitem = NULL; item = cJSON_GetObjectItem(data_json,"verifyList"); @@ -503,6 +503,7 @@ cJSON *get_query_from_request(const char *data, int thread_id) { if(verify_type == VERIFY_TYPE_REGEX) { + mesa_runtime_log(RLOG_LV_DEBUG, " [I] data= %s", data); hit_cnt = get_query_result_regex(subitem, data_obj); }