]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output/redis: Redis threaded output changes
authorJeff Lucovsky <jeff@lucovsky.org>
Fri, 26 Mar 2021 14:06:44 +0000 (10:06 -0400)
committerVictor Julien <victor@inliniac.net>
Wed, 5 May 2021 18:12:34 +0000 (20:12 +0200)
src/output-json.c
src/util-log-redis.c

index 82637ad83ae6998194453d322d392b617ce5575b..9c4d9f63bc3bccfd22b2130ada6c35ae0018fe98 100644 (file)
@@ -1182,7 +1182,6 @@ OutputInitResult OutputJsonInitCtx(ConfNode *conf)
             }
 
             if (SCConfLogOpenRedis(redis_node, json_ctx->file_ctx) < 0) {
-                SCFree(json_ctx->file_ctx->sensor_name);
                 LogFileFreeCtx(json_ctx->file_ctx);
                 SCFree(json_ctx);
                 SCFree(output_ctx);
index 4f437f02ba6458dc9cf469416a537f53d003c7e0..544bef15457813f0ce5ed7519497efe3a3cc4f78 100644 (file)
@@ -1,5 +1,5 @@
 /* vi: set et ts=4: */
-/* Copyright (C) 2007-2016 Open Information Security Foundation
+/* Copyright (C) 2007-2021 Open Information Security Foundation
  *
  * You can copy, redistribute or modify this Program under the terms of
  * the GNU General Public License version 2 as published by the Free
@@ -53,7 +53,7 @@ void SCLogRedisInit()
 #endif /* HAVE_LIBEVENT_PTHREADS */
 }
 
-/** \brief SCLogRedisContextAlloc() - Allocates and initalizes redis context
+/** \brief SCLogRedisContextAlloc() - Allocates and initializes redis context
  */
 static SCLogRedisContext *SCLogRedisContextAlloc(void)
 {
@@ -430,7 +430,7 @@ static int SCLogRedisWriteSync(LogFileCtx *file_ctx, const char *string)
  * \param log_ctx Log file context allocated by caller
  * \param string buffer with data to write
  * \param string_len data length
- * \retval 0 on sucess;
+ * \retval 0 on success;
  * \retval -1 on failure;
  */
 int LogFileWriteRedis(void *lf_ctx, const char *string, size_t string_len)
@@ -462,6 +462,10 @@ int SCConfLogOpenRedis(ConfNode *redis_node, void *lf_ctx)
 {
     LogFileCtx *log_ctx = lf_ctx;
 
+    if (log_ctx->threaded) {
+        FatalError(SC_ERR_FATAL, "redis does not support threaded output");
+    }
+
     const char *redis_port = NULL;
     const char *redis_mode = NULL;