mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2025-02-23 07:33:15 +08:00
fix: resolver's defer
This commit is contained in:
parent
1880a485f8
commit
994e85425f
@ -159,9 +159,9 @@ func (r *Resolver) ExchangeContext(ctx context.Context, m *D.Msg) (msg *D.Msg, e
|
||||
continueFetch := false
|
||||
defer func() {
|
||||
if continueFetch || errors.Is(err, context.DeadlineExceeded) || errors.Is(err, context.Canceled) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), resolver.DefaultDNSTimeout)
|
||||
defer cancel()
|
||||
go func() {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), resolver.DefaultDNSTimeout)
|
||||
defer cancel()
|
||||
_, _ = r.exchangeWithoutCache(ctx, m) // ignore result, just for putMsgToCache
|
||||
}()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user