diff options
author | WangXi <xib1102@icloud.com> | 2024-05-16 15:01:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-16 07:01:16 +0000 |
commit | f2d6722348d8ba51b4e7b11ad1176f73cb75a3b1 (patch) | |
tree | 3fb953ec3029aba7e76f7997682e25cf03bff0d7 | |
parent | 7b1b77e50da147fb6ec8e461d8c049588adf4b7f (diff) |
lib/connections: Use proper errors.Is check (#9538)
-rw-r--r-- | lib/connections/quic_listen.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/connections/quic_listen.go b/lib/connections/quic_listen.go index df1384df6e..2418a04043 100644 --- a/lib/connections/quic_listen.go +++ b/lib/connections/quic_listen.go @@ -12,6 +12,7 @@ package connections import ( "context" "crypto/tls" + "errors" "net" "net/url" "sync" @@ -145,7 +146,7 @@ func (t *quicListener) serve(ctx context.Context) error { } session, err := listener.Accept(ctx) - if err == context.Canceled { + if errors.Is(err, context.Canceled) { return nil } else if err != nil { l.Infoln("Listen (BEP/quic): Accepting connection:", err) |