ssh: remove single logger limit

pull/2559/head
Victor Julien 9 years ago
parent 3ee4989ba7
commit c412352474

@ -173,8 +173,6 @@ static TmEcode JsonSshLogThreadDeinit(ThreadVars *t, void *data)
static void OutputSshLogDeinit(OutputCtx *output_ctx) static void OutputSshLogDeinit(OutputCtx *output_ctx)
{ {
OutputSshLoggerDisable();
OutputSshCtx *ssh_ctx = output_ctx->data; OutputSshCtx *ssh_ctx = output_ctx->data;
LogFileCtx *logfile_ctx = ssh_ctx->file_ctx; LogFileCtx *logfile_ctx = ssh_ctx->file_ctx;
LogFileFreeCtx(logfile_ctx); LogFileFreeCtx(logfile_ctx);
@ -185,12 +183,6 @@ static void OutputSshLogDeinit(OutputCtx *output_ctx)
#define DEFAULT_LOG_FILENAME "ssh.json" #define DEFAULT_LOG_FILENAME "ssh.json"
OutputCtx *OutputSshLogInit(ConfNode *conf) OutputCtx *OutputSshLogInit(ConfNode *conf)
{ {
if (OutputSshLoggerEnable() != 0) {
SCLogError(SC_ERR_CONF_YAML_ERROR, "only one 'ssh' logger "
"can be enabled");
return NULL;
}
LogFileCtx *file_ctx = LogFileNewCtx(); LogFileCtx *file_ctx = LogFileNewCtx();
if(file_ctx == NULL) { if(file_ctx == NULL) {
SCLogError(SC_ERR_SSH_LOG_GENERIC, "couldn't create new file_ctx"); SCLogError(SC_ERR_SSH_LOG_GENERIC, "couldn't create new file_ctx");
@ -226,8 +218,6 @@ OutputCtx *OutputSshLogInit(ConfNode *conf)
static void OutputSshLogDeinitSub(OutputCtx *output_ctx) static void OutputSshLogDeinitSub(OutputCtx *output_ctx)
{ {
OutputSshLoggerDisable();
OutputSshCtx *ssh_ctx = output_ctx->data; OutputSshCtx *ssh_ctx = output_ctx->data;
SCFree(ssh_ctx); SCFree(ssh_ctx);
SCFree(output_ctx); SCFree(output_ctx);
@ -237,12 +227,6 @@ OutputCtx *OutputSshLogInitSub(ConfNode *conf, OutputCtx *parent_ctx)
{ {
OutputJsonCtx *ojc = parent_ctx->data; OutputJsonCtx *ojc = parent_ctx->data;
if (OutputSshLoggerEnable() != 0) {
SCLogError(SC_ERR_CONF_YAML_ERROR, "only one 'ssh' logger "
"can be enabled");
return NULL;
}
OutputSshCtx *ssh_ctx = SCMalloc(sizeof(OutputSshCtx)); OutputSshCtx *ssh_ctx = SCMalloc(sizeof(OutputSshCtx));
if (unlikely(ssh_ctx == NULL)) if (unlikely(ssh_ctx == NULL))
return NULL; return NULL;

@ -849,22 +849,6 @@ void OutputDropLoggerDisable(void)
drop_loggers--; drop_loggers--;
} }
static int ssh_loggers = 0;
int OutputSshLoggerEnable(void)
{
if (ssh_loggers)
return -1;
ssh_loggers++;
return 0;
}
void OutputSshLoggerDisable(void)
{
if (ssh_loggers)
ssh_loggers--;
}
/** /**
* \brief Register a flag for file rotation notification. * \brief Register a flag for file rotation notification.
* *

@ -184,9 +184,6 @@ void OutputDeregisterAll(void);
int OutputDropLoggerEnable(void); int OutputDropLoggerEnable(void);
void OutputDropLoggerDisable(void); void OutputDropLoggerDisable(void);
int OutputSshLoggerEnable(void);
void OutputSshLoggerDisable(void);
void OutputRegisterFileRotationFlag(int *flag); void OutputRegisterFileRotationFlag(int *flag);
void OutputUnregisterFileRotationFlag(int *flag); void OutputUnregisterFileRotationFlag(int *flag);
void OutputNotifyFileRotation(void); void OutputNotifyFileRotation(void);

Loading…
Cancel
Save