修复bug:李碧发现在初始化后,首次调用maat_cmd_set_lines会段错误,这是由于写redis句柄未进行初始化导致。
This commit is contained in:
@@ -120,7 +120,7 @@ struct Maat_line_t
|
|||||||
{
|
{
|
||||||
const char* table_name;
|
const char* table_name;
|
||||||
const char* table_line;
|
const char* table_line;
|
||||||
int rule_id; // for MAAT_OP_DEL, only rule_id is necessary.
|
int rule_id; // for MAAT_OP_DEL, only rule_id and table_name are necessary.
|
||||||
int label_id;
|
int label_id;
|
||||||
int expire_after; //expired after $timeout$ seconds, set to 0 for never timeout.
|
int expire_after; //expired after $timeout$ seconds, set to 0 for never timeout.
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1220,6 +1220,14 @@ int Maat_cmd_set_lines(Maat_feather_t feather,const struct Maat_line_t** line_ru
|
|||||||
int ret=0, table_id=0,retry=0,success_cnt=0;
|
int ret=0, table_id=0,retry=0,success_cnt=0;
|
||||||
struct serial_rule_t *s_rule=NULL;
|
struct serial_rule_t *s_rule=NULL;
|
||||||
long long server_time=0,absolute_expire_time=0;
|
long long server_time=0,absolute_expire_time=0;
|
||||||
|
if(_feather->redis_write_ctx==NULL)
|
||||||
|
{
|
||||||
|
ret=connect_redis_for_write(_feather);
|
||||||
|
if(ret!=0)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
server_time=redis_server_time(_feather->redis_write_ctx);
|
server_time=redis_server_time(_feather->redis_write_ctx);
|
||||||
s_rule=(struct serial_rule_t *)calloc(sizeof(struct serial_rule_t),line_num);
|
s_rule=(struct serial_rule_t *)calloc(sizeof(struct serial_rule_t),line_num);
|
||||||
for(i=0;i<line_num;i++)
|
for(i=0;i<line_num;i++)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
#include "stream_fuzzy_hash.h"
|
#include "stream_fuzzy_hash.h"
|
||||||
#include "gram_index_engine.h"
|
#include "gram_index_engine.h"
|
||||||
|
|
||||||
int MAAT_FRAME_VERSION_2_1_20171107=1;
|
int MAAT_FRAME_VERSION_2_1_20171205=1;
|
||||||
|
|
||||||
const char* CHARSET_STRING[]={"NONE","gbk","big5","unicode","utf8","bin",
|
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",""};
|
"unicode_ascii_esc","unicode_ascii_aligned","unicode_ncr_dec","unicode_ncr_hex","url_encode_gb2312","url_encode_utf8",""};
|
||||||
|
|||||||
Reference in New Issue
Block a user