diff options
author | anon5 <anon5clam@protonmail.com> | 2021-02-28 18:54:41 +0000 |
---|---|---|
committer | anon5 <anon5clam@protonmail.com> | 2021-02-28 18:54:41 +0000 |
commit | 7d69943c17614bcf6733ff0b3206374d272e274b (patch) | |
tree | 29301ea544edf7b37442f79e0a6085a28d0cf7e3 /rudp/proxy/proxy.go | |
parent | 27c0776cb2f1084356df5c9f6080fecf20f8fddf (diff) |
rudp: fix errors returned by Peer.Recv other than net.ErrClosed when the Peer is closed
Diffstat (limited to 'rudp/proxy/proxy.go')
-rw-r--r-- | rudp/proxy/proxy.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/rudp/proxy/proxy.go b/rudp/proxy/proxy.go index 833260b..a80b448 100644 --- a/rudp/proxy/proxy.go +++ b/rudp/proxy/proxy.go @@ -10,12 +10,13 @@ and listen:port is the address to listen on. package main import ( + "errors" "fmt" "log" "net" "os" - "mt/rudp" + "github.com/anon55555/mt/rudp" ) func main() { @@ -61,7 +62,7 @@ func proxy(src, dest *rudp.Peer) { for { pkt, err := src.Recv() if err != nil { - if err == net.ErrClosed { + if errors.Is(err, net.ErrClosed) { msg := src.Addr().String() + " disconnected" if src.TimedOut() { msg += " (timed out)" |