Skip to content

Commit

Permalink
1833 Fix syslog udp (#1835)
Browse files Browse the repository at this point in the history
* # 1183 - Update syslog UDP listener deadline

* #1833 - Update syslog UDP listener deadline v2

* #1833 - Update syslog UDP listener deadline v3
  • Loading branch information
df3rry authored Jan 8, 2024
1 parent fd8e5e9 commit 24a09bc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/sources/syslog/syslog.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@ func (s *Source) acceptUDPConnections(ctx context.Context, netListener net.Packe
if common.IsDone(ctx) {
return nil
}
err := netListener.SetDeadline(time.Now().Add(time.Second))
if err != nil {
ctx.Logger().V(2).Info("could not update connection deadline", "error", err)
}
input := make([]byte, 65535)
_, remote, err := netListener.ReadFrom(input)
if err != nil {
Expand Down

0 comments on commit 24a09bc

Please sign in to comment.