From ad15c6ec50fa635ae931d2622be738a3e4195e30 Mon Sep 17 00:00:00 2001 From: zhengchao Date: Sun, 23 Apr 2017 12:19:36 +0800 Subject: [PATCH] =?UTF-8?q?=20=E6=94=B9=E8=BF=9B=E5=AF=B9digest=E7=B1=BB?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=89=AB=E6=8F=8F=E9=80=9F=E5=BA=A6=E7=9A=84?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=96=B9=E5=BC=8F=EF=BC=8C=E5=8E=9F=E6=9D=A5?= =?UTF-8?q?=E5=8F=AA=E5=AF=B9=E8=A7=A6=E5=8F=91GIE=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=9A=84=E8=BE=93=E5=85=A5=E5=81=9A=E7=BB=9F=E8=AE=A1=EF=BC=8C?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E6=89=80=E6=9C=89=E8=BE=93=E5=85=A5=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E9=83=BD=E8=AE=A1=E5=85=A5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entry/Maat_api.cpp | 10 ++++++---- src/entry/Maat_rule.cpp | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/entry/Maat_api.cpp b/src/entry/Maat_api.cpp index 0092936..1eaf731 100644 --- a/src/entry/Maat_api.cpp +++ b/src/entry/Maat_api.cpp @@ -1448,7 +1448,7 @@ int Maat_stream_scan_digest(stream_para_t * stream_para, const char * data, int } if(sp->acc_scan_len+(unsigned long long)data_len > sp->total_len) { - return 0; + goto fast_out; } aligment_int64_array_add(sp->feather->thread_call_cnt, sp->thread_num, 1); pthread_mutex_lock(&(sp->fuzzy_mutex)); @@ -1457,14 +1457,14 @@ int Maat_stream_scan_digest(stream_para_t * stream_para, const char * data, int do_query=REACH_QUERY_THRESH(sp->total_len, sp->acc_scan_len, sp->query_point,8); if(do_query==0) { - return 0; + goto fast_out; } pthread_mutex_lock(&(sp->fuzzy_mutex)); digest_len=fuzzy_status(sp->fuzzy_hash_handle, HASH_LENGTH); pthread_mutex_unlock(&(sp->fuzzy_mutex)); if(digest_len==0) { - return 0; + goto fast_out; } digest_buff=(char*)malloc(sizeof(char)*digest_len); pthread_mutex_lock(&(sp->fuzzy_mutex)); @@ -1483,7 +1483,8 @@ int Maat_stream_scan_digest(stream_para_t * stream_para, const char * data, int if(hit_region_cnt<0)//error occurs { sp->feather->scan_err_cnt++; - return -1; + compile_ret=-1; + goto fast_out; } if(hit_region_cnt>0) { @@ -1496,6 +1497,7 @@ int Maat_stream_scan_digest(stream_para_t * stream_para, const char * data, int sp->thread_num); } +fast_out: if(sp->feather->perf_on==1) { clock_gettime(CLOCK_MONOTONIC,&end); diff --git a/src/entry/Maat_rule.cpp b/src/entry/Maat_rule.cpp index 249e3a2..6d05d59 100644 --- a/src/entry/Maat_rule.cpp +++ b/src/entry/Maat_rule.cpp @@ -28,7 +28,7 @@ #include "mesa_fuzzy.h" #include "great_index_engine.h" -int MAAT_FRAME_VERSION_1_8_20170217=1; +int MAAT_FRAME_VERSION_1_8_20170423=1; const char *maat_module="MAAT Frame"; const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin",