修复bug:李碧发现在初始化后,首次调用maat_cmd_set_lines会段错误,这是由于写redis句柄未进行初始化导致。

This commit is contained in:
zhengchao
2017-12-05 16:10:08 +08:00
parent e4985747a8
commit 1d3c2f8f2c
3 changed files with 10 additions and 2 deletions

View File

@@ -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;
struct serial_rule_t *s_rule=NULL;
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);
s_rule=(struct serial_rule_t *)calloc(sizeof(struct serial_rule_t),line_num);
for(i=0;i<line_num;i++)