diff --git a/inc/Maat_rule.h b/inc/Maat_rule.h index b7e21a9..d9f1d49 100644 --- a/inc/Maat_rule.h +++ b/inc/Maat_rule.h @@ -175,7 +175,7 @@ enum MAAT_SCAN_OPT int Maat_set_scan_status(Maat_feather_t feather,scan_status_t* mid,enum MAAT_SCAN_OPT type,const void* value,int size); //Return hit rule number, return -1 when error occurs,return -2 when hit current region -//mid MUST set NULL before fist call +//mid MUST set to NULL before fist call int Maat_scan_intval(Maat_feather_t feather,int table_id ,unsigned int intval ,struct Maat_rule_t*result,int rule_num diff --git a/src/entry/Maat_command.cpp b/src/entry/Maat_command.cpp index 5dd7cec..f22edfc 100644 --- a/src/entry/Maat_command.cpp +++ b/src/entry/Maat_command.cpp @@ -419,6 +419,7 @@ int get_rm_key_list(unsigned int version,redisContext *c,struct serial_rule_t** assert(reply->type==REDIS_REPLY_ARRAY); if(reply->elements==0) { + //a duplicate rule_id would induce this error. MESA_handle_runtime_log(logger, RLOG_LV_FATAL, maat_redis_monitor,"Got nothing after ZRANGEBYSCORE %s (%d %d",rm_status_sset,version,version_in_redis); freeReplyObject(reply); return -1; @@ -616,7 +617,7 @@ int calculate_serial_rule_num(struct _Maat_cmd_inner_t* _cmd,int * new_region_cn *new_region_cnt+=cmd->groups[i].region_num; (*new_group_cnt)++; } - //for MAAT_OP_DEL, if the group's refcnt>0, group->region_num=0. + //for MAAT_OP_DEL, if the group's refcnt>1, group->region_num=0. //so it's OK to add. serial_num+=cmd->groups[i].region_num; } diff --git a/test/Makefile b/test/Makefile index 9c83e95..f020103 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,8 +1,6 @@ -LIBS= ../lib/libmaatframe.so -lhiredis_vip -INC=-I../inc/ -I ../src/entry/ -I../src/inc_internal/ -I/usr/include/MESA/ +LIBS=../lib/libmaatframe.so +INC=-I../inc/ -I/usr/include/MESA/ all: - g++ -o maat_redis_tool.o -c -g -Wall maat_redis_tool.cpp $(INC) - g++ -o maat_redis_tool maat_redis_tool.o $(LIBS) - g++ -o digest_gen -g digest_gen.c $(INC) $(LIBS) + g++ -o maat_test -g -Wall maat_test.cpp $(INC) $(LIBS) -lMESA_handle_logger clean: - rm *.o + rm maat_test test.log* -f