Merge pull request #493 from rookisbusy/Alpha

fix: tun warn timeout
This commit is contained in:
rookisbusy 2023-04-09 19:03:10 +08:00 committed by GitHub
commit 9e6b4dca97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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