From 4b7623511a242ef6a4a0bcf7139717683ecc0696 Mon Sep 17 00:00:00 2001 From: Denis Machard <5562930+dmachard@users.noreply.github.com> Date: Fri, 19 Jan 2024 22:31:43 +0100 Subject: [PATCH] syslog logger: fix crash when syslog refused connection (#551) --- loggers/syslog.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/loggers/syslog.go b/loggers/syslog.go index a913fdfa..aff24178 100644 --- a/loggers/syslog.go +++ b/loggers/syslog.go @@ -371,8 +371,8 @@ func (s *Syslog) FlushBuffer(buf *[]dnsutils.DNSMessage) { if err != nil { s.LogError("write error %s", err) s.syslogReady = false - s.syslogWriter.Close() <-s.transportReconnect + break } } @@ -426,9 +426,7 @@ PROCESS_LOOP: // flush the buffer case <-flushTimer.C: if !s.syslogReady { - s.LogInfo("buffer cleared!") bufferDm = nil - continue } if len(bufferDm) > 0 {