From: Eric Leblond Date: Thu, 23 Jan 2020 12:10:44 +0000 (+0100) Subject: redis: fix reconnect in batch mode X-Git-Tag: suricata-6.0.0-beta1~350 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec8eba28a8ec0b7cb6eba5291da0174e8ab018db;p=thirdparty%2Fsuricata.git redis: fix reconnect in batch mode In case of redis outage, the redis session was reset but the replies were still fetch even if there is none replies in the new session. --- diff --git a/src/util-log-redis.c b/src/util-log-redis.c index afc4d4858a..4c4d37f2e9 100644 --- a/src/util-log-redis.c +++ b/src/util-log-redis.c @@ -369,6 +369,12 @@ static int SCLogRedisWriteSync(LogFileCtx *file_ctx, const char *string) redis = ctx->sync; if (redis) { SCLogInfo("Reconnected to redis server"); + redisAppendCommand(redis, "%s %s %s", + file_ctx->redis_setup.command, + file_ctx->redis_setup.key, + string); + ctx->batch_count++; + return 0; } else { SCLogInfo("Unable to reconnect to redis server"); return -1;