From f87e3be545c4643155ced27e7eec9426db6eee9c Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Tue, 15 Nov 2022 16:21:35 +0200 Subject: [PATCH] Do not show a warning for closed connections Do not show a warning for closed connections --- candidate_base.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/candidate_base.go b/candidate_base.go index 286e836..4761d5a 100644 --- a/candidate_base.go +++ b/candidate_base.go @@ -2,8 +2,10 @@ package ice import ( "context" + "errors" "fmt" "hash/crc32" + "io" "net" "strconv" "strings" @@ -219,7 +221,9 @@ func (c *candidateBase) recvLoop(initializedCh <-chan struct{}) { for { n, srcAddr, err := c.conn.ReadFrom(buf) if err != nil { - a.log.Warnf("Failed to read from candidate %s: %v", c, err) + if !(errors.Is(err, io.EOF) || errors.Is(err, net.ErrClosed)) { + a.log.Warnf("Failed to read from candidate %s: %v", c, err) + } return }