util-logopenfile: log queued events at exit

Do a redis query at exit to log possibly existing events.
pull/1712/head
Eric Leblond 11 years ago committed by Victor Julien
parent 404e660410
commit 7e3a5a0db2

@ -335,8 +335,17 @@ int SCConfLogReopen(LogFileCtx *log_ctx)
static void SCLogFileCloseRedis(LogFileCtx *log_ctx)
{
if (log_ctx->redis)
if (log_ctx->redis) {
redisReply *reply;
int i;
for (i = 0; i < log_ctx->redis_setup.batch_count; i++) {
redisGetReply(log_ctx->redis, (void **)&reply);
if (reply)
freeReplyObject(reply);
}
redisFree(log_ctx->redis);
log_ctx->redis = NULL;
}
log_ctx->redis_setup.tried = 0;
log_ctx->redis_setup.batch_count = 0;
}

Loading…
Cancel
Save