Do not show a warning for closed connections

Do not show a warning for closed connections
This commit is contained in:
Steffen Vogel
2022-11-16 09:52:12 +02:00
parent bce6de3c84
commit f87e3be545
+5 -1
View File
@@ -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
}