Skip to content

Commit

Permalink
Do not show a warning for closed connections
Browse files Browse the repository at this point in the history
Do not show a warning for closed connections
  • Loading branch information
stv0g committed Nov 16, 2022
1 parent bce6de3 commit f87e3be
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion candidate_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package ice

import (
"context"
"errors"
"fmt"
"hash/crc32"
"io"
"net"
"strconv"
"strings"
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit f87e3be

Please sign in to comment.