From 9df045d086f9399eee25f63886c9fdaf84f10f66 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 10 Apr 2014 08:13:38 +0200 Subject: [PATCH] output: add Disable funcs to mirror Enable For the loggers that we allow only one instance for: tls, ssh, drop, we track active loggers through Output*Enable functions. Add Disable functions to mirror this. They are to be called from the shutdown funcs those loggers use. --- src/output.c | 15 +++++++++++++++ src/output.h | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/src/output.c b/src/output.c index 1ab53c633b..eb005651d5 100644 --- a/src/output.c +++ b/src/output.c @@ -384,6 +384,11 @@ int OutputDropLoggerEnable(void) { return 0; } +void OutputDropLoggerDisable(void) { + if (drop_loggers) + drop_loggers--; +} + static int tls_loggers = 0; int OutputTlsLoggerEnable(void) { @@ -393,6 +398,11 @@ int OutputTlsLoggerEnable(void) { return 0; } +void OutputTlsLoggerDisable(void) { + if (tls_loggers) + tls_loggers--; +} + static int ssh_loggers = 0; int OutputSshLoggerEnable(void) { @@ -401,3 +411,8 @@ int OutputSshLoggerEnable(void) { ssh_loggers++; return 0; } + +void OutputSshLoggerDisable(void) { + if (ssh_loggers) + ssh_loggers--; +} diff --git a/src/output.h b/src/output.h index a68b02b91a..e62e2b1882 100644 --- a/src/output.h +++ b/src/output.h @@ -84,7 +84,12 @@ OutputModule *OutputGetModuleByConfName(const char *name); void OutputDeregisterAll(void); int OutputDropLoggerEnable(void); +void OutputDropLoggerDisable(void); + int OutputTlsLoggerEnable(void); +void OutputTlsLoggerDisable(void); + int OutputSshLoggerEnable(void); +void OutputSshLoggerDisable(void); #endif /* ! __OUTPUT_H__ */