Skip to content

Commit

Permalink
syslog logger: fix crash when syslog refused connection (#551)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmachard authored Jan 19, 2024
1 parent 1e696cf commit 4b76235
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions loggers/syslog.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 4b76235

Please sign in to comment.