mirror of
https://github.com/netbirdio/ice.git
synced 2026-05-22 17:10:58 -07:00
Return ErrClosedPipe for writeTo
Return ErrClosedPipe for writeTo
This commit is contained in:
committed by
Steffen Vogel
parent
3fe1ae7c2b
commit
d99a6fcb7c
@@ -308,6 +308,10 @@ func (c *candidateBase) close() error {
|
||||
func (c *candidateBase) writeTo(raw []byte, dst Candidate) (int, error) {
|
||||
n, err := c.conn.WriteTo(raw, dst.addr())
|
||||
if err != nil {
|
||||
// If the connection is closed, we should return the error
|
||||
if errors.Is(err, io.ErrClosedPipe) {
|
||||
return n, err
|
||||
}
|
||||
c.agent().log.Infof("%s: %v", errSendPacket, err)
|
||||
return n, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user