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.
pull/926/head
Victor Julien 11 years ago
parent 4a104ae315
commit 9df045d086

@ -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--;
}

@ -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__ */

Loading…
Cancel
Save