#17 命中包含“非”规则的编译配置时,如果不是最后一次扫描(未设置MAAT_SET_SCAN_LAST_REGION),则只记录状态,不算命中。当设置MAAT_SET_SCAN_LAST_REGION后,无论是否命中域配置,都做region_compile。

This commit is contained in:
zhengchao
2019-01-08 21:25:08 +06:00
parent 9c0a0786ab
commit deb41ea520
5 changed files with 196 additions and 64 deletions

View File

@@ -917,7 +917,8 @@ void walk_compile_hash(const uchar * key, uint size, void * data, void * user)
//make sure compile rule's each group has loadded.
if((compile_rule->group_cnt==compile_rule->db_c_rule->declare_grp_num
||compile_rule->db_c_rule->declare_grp_num==0)//for compatible old version
&&compile_rule->group_cnt>0)
&&compile_rule->group_cnt>0
&&compile_rule->group_cnt!=compile_rule->not_group_cnt)
{
one_set=ALLOC(struct bool_expr, 1);
//reading compile rule is safe in update thread, mutex lock called when modified
@@ -1403,7 +1404,7 @@ void destroy_maat_scanner(struct Maat_scanner_t*scanner)
map_destroy(scanner->district_map);
scanner->district_map=NULL;
assert(scanner->tmp_district_map==NULL);
destroy_bool_matcher(scanner->bool_macher_expr_compiler);
destroy_bool_matcher(scanner->bool_matcher_expr_compiler);
q_cnt=MESA_lqueue_get_count(scanner->region_update_q);
for(i=0;i<q_cnt;i++)
{
@@ -3309,10 +3310,10 @@ void do_scanner_update(struct Maat_scanner_t* scanner,MESA_lqueue_head garbage_q
tmp1=create_bool_matcher(scanner->compile_hash,
scan_thread_num,
logger);
tmp2=scanner->bool_macher_expr_compiler;
tmp2=scanner->bool_matcher_expr_compiler;
//assume pinter = operation is thread safe
scanner->bool_macher_expr_compiler=tmp1;
scanner->bool_matcher_expr_compiler=tmp1;
if(tmp2!=NULL)
{
garbage_bagging(GARBAGE_BOOL_MATCHER, tmp2, garbage_q);