From 1d3c2f8f2cd563318e1fe5c4f3de57ec37b3d7f4 Mon Sep 17 00:00:00 2001 From: zhengchao Date: Tue, 5 Dec 2017 16:10:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug=EF=BC=9A=E6=9D=8E?= =?UTF-8?q?=E7=A2=A7=E5=8F=91=E7=8E=B0=E5=9C=A8=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E9=A6=96=E6=AC=A1=E8=B0=83=E7=94=A8maat=5Fcm?= =?UTF-8?q?d=5Fset=5Flines=E4=BC=9A=E6=AE=B5=E9=94=99=E8=AF=AF=EF=BC=8C?= =?UTF-8?q?=E8=BF=99=E6=98=AF=E7=94=B1=E4=BA=8E=E5=86=99redis=E5=8F=A5?= =?UTF-8?q?=E6=9F=84=E6=9C=AA=E8=BF=9B=E8=A1=8C=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/Maat_command.h | 2 +- src/entry/Maat_command.cpp | 8 ++++++++ src/entry/Maat_rule.cpp | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/inc/Maat_command.h b/inc/Maat_command.h index 1ccefe8..e457646 100644 --- a/inc/Maat_command.h +++ b/inc/Maat_command.h @@ -120,7 +120,7 @@ struct Maat_line_t { const char* table_name; 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 expire_after; //expired after $timeout$ seconds, set to 0 for never timeout. }; diff --git a/src/entry/Maat_command.cpp b/src/entry/Maat_command.cpp index 7ce9ce3..9b056cd 100644 --- a/src/entry/Maat_command.cpp +++ b/src/entry/Maat_command.cpp @@ -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