lib/connections: Use proper errors.Is check (#9538)

This commit is contained in:
WangXi 2024-05-16 15:01:16 +08:00 committed by GitHub
parent 7b1b77e50d
commit f2d6722348
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)