Fix timeout check

This commit is contained in:
世界 2025-09-10 17:40:01 +08:00
parent 36babe4bef
commit c331ee3d5c
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
2 changed files with 2 additions and 4 deletions

View File

@ -8,7 +8,6 @@ import (
"net"
"net/http"
"net/url"
"os"
"strconv"
"sync"
"time"
@ -178,7 +177,7 @@ func (t *HTTPSTransport) Exchange(ctx context.Context, message *mDNS.Msg) (*mDNS
startAt := time.Now()
response, err := t.exchange(ctx, message)
if err != nil {
if errors.Is(err, os.ErrDeadlineExceeded) {
if errors.Is(err, context.DeadlineExceeded) {
t.transportAccess.Lock()
defer t.transportAccess.Unlock()
if t.transportResetAt.After(startAt) {

View File

@ -5,7 +5,6 @@ import (
"errors"
"net"
"net/netip"
"os"
"strings"
"time"
@ -628,7 +627,7 @@ func (r *Router) actionSniff(
}
if err != nil {
sniffBuffer.Release()
if !errors.Is(err, os.ErrDeadlineExceeded) {
if !errors.Is(err, context.DeadlineExceeded) {
fatalErr = err
return
}