From f4cf4917a3c9e573fe7c168aeebd31bed85013e0 Mon Sep 17 00:00:00 2001 From: Thomas Ries Date: Tue, 29 Jun 2021 23:09:56 +0200 Subject: [PATCH] fix: silence_log handling - was always logging everything to syslog,even if set to >0 --- ChangeLog | 2 ++ src/plugin_blacklist.c | 2 +- src/siproxd.c | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 172c2e7..af1ca8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 0.8.4dev ======== + 29-Jun-2021: - fix: silence_log handling - was always logging + everything to syslog,even if set to >0 27-Dec-2020: - plugin_stripheaders: deal with mode header field 17-Sep-2020: - fix: buffer overflow in process_aclist if a wrong syntax in config file was used for ACLs. diff --git a/src/plugin_blacklist.c b/src/plugin_blacklist.c index 69ef361..e8d1bec 100644 --- a/src/plugin_blacklist.c +++ b/src/plugin_blacklist.c @@ -241,7 +241,7 @@ int PLUGIN_PROCESS(int stage, sip_ticket_t *ticket){ && MSG_IS_RESPONSE(ticket->sipmsg) && MSG_IS_RESPONSE_FOR(ticket->sipmsg, "REGISTER")) { sts = blacklist_update(ticket); - } else if ((stage == PLUGIN_TIMER)) { + } else if (stage == PLUGIN_TIMER) { static int count=0; /*&&&TODO: hmmm, still hardcoded... will be executed once per minute */ if (++count >= 12) { diff --git a/src/siproxd.c b/src/siproxd.c index 9b15ef1..c9baa62 100644 --- a/src/siproxd.c +++ b/src/siproxd.c @@ -152,8 +152,6 @@ int main (int argc, char *argv[]) * initialize the loggin subsystem */ log_init(); - /* set log silencing for syslog as requested in config */ - log_set_silence(configuration.silence_log); /* while not daemonized, log also to stderr */ log_set_stderr(1); @@ -257,6 +255,9 @@ int main (int argc, char *argv[]) configuration.debuglevel=cmdline_debuglevel; } + /* set log silencing for syslog as requested in config */ + log_set_silence(configuration.silence_log); + /* * open a the pwfile instance, so we still have access after * we possibly have chroot()ed to somewhere.