fix: tun warn timeout

This commit is contained in:
rookisbusy 2023-04-09 19:00:45 +08:00
parent 8fb2c68722
commit 99dfa4c73a

View file

@ -6,6 +6,7 @@ import (
"io"
"net"
"net/netip"
"os"
"sync"
"time"
@ -117,7 +118,8 @@ func (h *ListenerHandler) NewPacketConnection(ctx context.Context, conn network.
dest, err := conn.ReadPacket(buff)
if err != nil {
buff.Release()
if E.IsClosed(err) {
// ignore simple error
if err == os.ErrDeadlineExceeded || E.IsClosed(err) {
break
}
return err