From c7af487e4183baf74f42d7059762285aed7143c0 Mon Sep 17 00:00:00 2001 From: zhengchao Date: Mon, 11 Sep 2017 18:58:29 +0800 Subject: [PATCH] =?UTF-8?q?Maat=E8=AF=BB=E5=8F=96redis=E5=87=BA=E9=94=99?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=9C=AA=E8=83=BD=E6=B8=85=E7=A9=BA=E5=B7=B2?= =?UTF-8?q?append=E7=9A=84=E6=95=B0=E6=8D=AE=EF=BC=8C=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E5=AF=BC=E8=87=B4TCP=E6=8E=A5=E6=94=B6=E9=98=9F=E5=88=97?= =?UTF-8?q?=E9=98=BB=E5=A1=9E=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entry/Maat_command.cpp | 36 +++++++++++++++++++++++++++++++----- src/entry/Maat_rule.cpp | 2 +- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/entry/Maat_command.cpp b/src/entry/Maat_command.cpp index b9441d8..89177b6 100644 --- a/src/entry/Maat_command.cpp +++ b/src/entry/Maat_command.cpp @@ -513,9 +513,11 @@ FULL_UPDATE: return full_idx ; } -int get_rm_value(redisContext *c,struct serial_rule_t* rule_list,int rule_num,void* logger) + +int _get_maat_redis_value(redisContext *c,struct serial_rule_t* rule_list,int rule_num,void* logger) { int i=0,ret=0,failed_cnt=0,idx=0; + int error_happened=0; int *retry_ids=(int*)malloc(sizeof(int)*rule_num); char redis_cmd[256]; redisReply* reply=NULL; @@ -547,16 +549,21 @@ int get_rm_value(redisContext *c,struct serial_rule_t* rule_list,int rule_num,vo ,"Redis GET %s:%s,%d failed",rm_key_prefix[rule_list[i].op] ,rule_list[i].table_name ,rule_list[i].rule_id); - free(retry_ids); - return -1; + error_happened=1; } } freeReplyObject(reply); } + if(error_happened==1) + { + free(retry_ids); + return -1; + } + for(i=0;i0) { - ret=get_rm_value(c,rule_list,rule_num, logger); + ret=get_maat_redis_value(c,rule_list,rule_num, logger); if(ret<0) { MESA_handle_runtime_log(logger,RLOG_LV_INFO,maat_redis_monitor,"Get Redis value failed, abandon update."); diff --git a/src/entry/Maat_rule.cpp b/src/entry/Maat_rule.cpp index bf5f9d4..d9bdddf 100644 --- a/src/entry/Maat_rule.cpp +++ b/src/entry/Maat_rule.cpp @@ -30,7 +30,7 @@ #include "stream_fuzzy_hash.h" #include "gram_index_engine.h" -int MAAT_FRAME_VERSION_2_0_20170910=1; +int MAAT_FRAME_VERSION_2_0_20170911=1; const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin", "unicode_ascii_esc","unicode_ascii_aligned","unicode_ncr_dec","unicode_ncr_hex","url_encode_gb2312","url_encode_utf8",""};