修复expr表无配置时,maat_stat文件输出的stream计数出现负数的bug。
This commit is contained in:
@@ -420,7 +420,7 @@ int fill_region_hit_detail(const char* scan_buff, const Maat_hierarchy_compile_m
|
|||||||
struct _OUTER_scan_status_t* _make_outer_status(_Maat_feather_t *feather, int thread_num)
|
struct _OUTER_scan_status_t* _make_outer_status(_Maat_feather_t *feather, int thread_num)
|
||||||
{
|
{
|
||||||
struct _OUTER_scan_status_t* outer_mid=NULL;
|
struct _OUTER_scan_status_t* outer_mid=NULL;
|
||||||
outer_mid=(struct _OUTER_scan_status_t*)calloc(sizeof(struct _OUTER_scan_status_t),1);
|
outer_mid=ALLOC(struct _OUTER_scan_status_t, 1);
|
||||||
outer_mid->feather=feather;
|
outer_mid->feather=feather;
|
||||||
outer_mid->district_id=DISTRICT_ANY;
|
outer_mid->district_id=DISTRICT_ANY;
|
||||||
outer_mid->thread_num=(unsigned short)thread_num;
|
outer_mid->thread_num=(unsigned short)thread_num;
|
||||||
@@ -1990,6 +1990,8 @@ stream_para_t Maat_stream_scan_string_start(Maat_feather_t feather,int table_id,
|
|||||||
|
|
||||||
struct Maat_table_runtime* table_rt=Maat_table_runtime_get(scanner->table_rt_mgr, sp->p_real_table->table_id);
|
struct Maat_table_runtime* table_rt=Maat_table_runtime_get(scanner->table_rt_mgr, sp->p_real_table->table_id);
|
||||||
INC_SCANNER_REF(scanner, thread_num);
|
INC_SCANNER_REF(scanner, thread_num);
|
||||||
|
alignment_int64_array_add(table_rt->stream_num, thread_num, 1);
|
||||||
|
|
||||||
if(table_rt->origin_rule_num==0)
|
if(table_rt->origin_rule_num==0)
|
||||||
{
|
{
|
||||||
return sp;
|
return sp;
|
||||||
@@ -2012,7 +2014,6 @@ stream_para_t Maat_stream_scan_string_start(Maat_feather_t feather,int table_id,
|
|||||||
{
|
{
|
||||||
sp->do_regex=1;
|
sp->do_regex=1;
|
||||||
}
|
}
|
||||||
alignment_int64_array_add(table_rt->stream_num,thread_num,1);
|
|
||||||
sp->rs_stream_para=rulescan_startstream(_feather->scanner->region,thread_num);
|
sp->rs_stream_para=rulescan_startstream(_feather->scanner->region,thread_num);
|
||||||
return sp;
|
return sp;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,17 +138,17 @@ void maat_stat_init(struct _Maat_feather_t* feather)
|
|||||||
offset=0;
|
offset=0;
|
||||||
for(j=0;j<p_table->conj_cnt;j++)
|
for(j=0;j<p_table->conj_cnt;j++)
|
||||||
{
|
{
|
||||||
offset+=snprintf(conj_table_name+offset,sizeof(conj_table_name)-offset
|
offset+=snprintf(conj_table_name+offset,sizeof(conj_table_name)-offset,
|
||||||
,"%s/",p_table->table_name[j]);
|
"%s/", p_table->table_name[j]);
|
||||||
}
|
}
|
||||||
conj_table_name[offset-1]='\0';//delete the last slash
|
conj_table_name[offset-1]='\0';//delete the last slash
|
||||||
if(strlen(conj_table_name)>MAX_CONJ_NAME_LEN)
|
if(strlen(conj_table_name)>MAX_CONJ_NAME_LEN)
|
||||||
{
|
{
|
||||||
conj_table_name[MAX_CONJ_NAME_LEN]='\0';
|
conj_table_name[MAX_CONJ_NAME_LEN]='\0';
|
||||||
}
|
}
|
||||||
p_table->stat_line_id=FS_register(feather->stat_handle
|
p_table->stat_line_id=FS_register(feather->stat_handle,
|
||||||
, FS_STYLE_LINE, FS_CALC_CURRENT
|
FS_STYLE_LINE, FS_CALC_CURRENT,
|
||||||
,conj_table_name);
|
conj_table_name);
|
||||||
}
|
}
|
||||||
FS_start(feather->stat_handle);
|
FS_start(feather->stat_handle);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user