aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWangXi <xib1102@icloud.com>2024-05-16 15:01:16 +0800
committerGitHub <noreply@github.com>2024-05-16 07:01:16 +0000
commitf2d6722348d8ba51b4e7b11ad1176f73cb75a3b1 (patch)
tree3fb953ec3029aba7e76f7997682e25cf03bff0d7 /lib
parent7b1b77e50da147fb6ec8e461d8c049588adf4b7f (diff)
downloadsyncthing-f2d6722348d8ba51b4e7b11ad1176f73cb75a3b1.tar.gz
syncthing-f2d6722348d8ba51b4e7b11ad1176f73cb75a3b1.zip
lib/connections: Use proper errors.Is check (#9538)
Diffstat (limited to 'lib')
-rw-r--r--lib/connections/quic_listen.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/connections/quic_listen.go b/lib/connections/quic_listen.go
index df1384df6..2418a0404 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)