From 7fd59cad78652e1aa7629bddeb9638869705a8fb Mon Sep 17 00:00:00 2001 From: zhengchao Date: Wed, 16 Nov 2016 17:30:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=91=8A=E8=AD=A6=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=EF=BC=9A=E5=9C=A8quickon=E6=A8=A1=E5=BC=8F=E4=B8=8B?= =?UTF-8?q?=EF=BC=8Crulescan=E4=BB=85=E6=94=AF=E6=8C=81=E5=AD=90=E4=B8=B2?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=EF=BC=8C=E4=B8=8D=E5=85=81=E8=AE=B8=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=B7=A6=E5=8C=B9=E9=85=8D=E3=80=81=E5=8F=B3=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E5=92=8C=E5=AE=8C=E5=85=A8=E5=8C=B9=E9=85=8D=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entry/Maat_rule.cpp | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/src/entry/Maat_rule.cpp b/src/entry/Maat_rule.cpp index 14d9072..5d790c0 100644 --- a/src/entry/Maat_rule.cpp +++ b/src/entry/Maat_rule.cpp @@ -26,7 +26,7 @@ #include "mesa_fuzzy.h" #include "great_index_engine.h" -int MAAT_FRAME_VERSION_1_8_20161025_zombie_stream=1; +int MAAT_FRAME_VERSION_1_8_20161116=1; const char *maat_module="MAAT Frame"; const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin", @@ -1410,14 +1410,6 @@ int add_expr_rule(struct _Maat_table_info_t* table,struct db_str_rule_t* db_rule switch(db_rule->expr_type) { case EXPR_TYPE_AND: - if(db_rule->match_method!=MATCH_METHOD_SUB) - { - MESA_handle_runtime_log(logger,RLOG_LV_FATAL,maat_module , - "Table %s region cfg %d is EXPR_TYPE_AND,but match method is not MATCH_METHOD_SUB,force fixed.", - table->table_name[table->updating_name],db_rule->region_id); - db_rule->match_method=MATCH_METHOD_SUB; - - } for(i=0,p=db_rule->keywords;;i++,p=NULL) { if(i>=MAAT_MAX_EXPR_ITEM_NUM) @@ -1971,7 +1963,7 @@ void update_expr_rule(struct _Maat_table_info_t* table,const char* table_line,st if(ret!=7) { MESA_handle_runtime_log(logger,RLOG_LV_FATAL,maat_module , - "update error,invalid format of expr table %s:%s",table->table_name[table->updating_name],table_line); + "abandon config: invalid format of expr table %s:%s",table->table_name[table->updating_name],table_line); free(maat_str_rule); maat_str_rule=NULL; table->udpate_err_cnt++; @@ -1990,7 +1982,7 @@ void update_expr_rule(struct _Maat_table_info_t* table,const char* table_line,st if(ret!=8) { MESA_handle_runtime_log(logger,RLOG_LV_FATAL,maat_module , - "update error,invalid format of expr_plus table %s:%s",table->table_name[table->updating_name],table_line); + "abandon config: invalid format of expr_plus table %s:%s",table->table_name[table->updating_name],table_line); free(maat_str_rule); maat_str_rule=NULL; table->udpate_err_cnt++; @@ -2017,7 +2009,7 @@ void update_expr_rule(struct _Maat_table_info_t* table,const char* table_line,st break; default: MESA_handle_runtime_log(logger,RLOG_LV_FATAL,maat_module , - "update error,invalid hexbin value of expr table %s:%s" + "abandon config:update error,invalid hexbin value of expr table %s:%s" ,table->table_name[table->updating_name],table_line); table->udpate_err_cnt++; goto error_out; @@ -2056,7 +2048,25 @@ void update_expr_rule(struct _Maat_table_info_t* table,const char* table_line,st } else { - + if(maat_str_rule->expr_type==EXPR_TYPE_AND + &&maat_str_rule->match_method!=MATCH_METHOD_SUB) + { + MESA_handle_runtime_log(logger,RLOG_LV_FATAL,maat_module , + "table %s region cfg %d is EXPR_TYPE_AND,but match method is not MATCH_METHOD_SUB,force fixed.", + table->table_name[table->updating_name],maat_str_rule->region_id); + maat_str_rule->match_method=MATCH_METHOD_SUB; + + } + if(maat_str_rule->expr_type==EXPR_TYPE_STRING + &&table->quick_expr_switch==1 + &&maat_str_rule->match_method!=MATCH_METHOD_SUB) + { + MESA_handle_runtime_log(logger,RLOG_LV_FATAL,maat_module , + "abandon config: table %s scan mode is quickon, only support MATCH_METHOD_SUB, conflict with match method of region %d.", + table->table_name[table->updating_name],maat_str_rule->region_id); + table->udpate_err_cnt++; + goto error_out; + } ret=add_expr_rule(table, maat_str_rule,scanner, logger); if(ret<0) {