From 7a2f2bcdb265f56e30ee728cc8e421b48db31ad8 Mon Sep 17 00:00:00 2001 From: tsosunchia <59512455+tsosunchia@users.noreply.github.com> Date: Mon, 27 Jul 2026 17:55:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(dns):=20=E5=9C=A8=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=89=8D=E7=BB=88=E6=AD=A2=E9=9D=9E=E6=AD=A3=E8=B6=85=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/dnsclient/runner.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/dnsclient/runner.go b/internal/dnsclient/runner.go index 1acedc3..25ad68a 100644 --- a/internal/dnsclient/runner.go +++ b/internal/dnsclient/runner.go @@ -189,6 +189,12 @@ func runTimedDNSWork( cleanup func(), work func(context.Context) error, ) error { + if totalTimeout <= 0 { + stdout.disable() + stderr.disable() + cleanup() + return normalizeRunError(context.DeadlineExceeded, totalTimeout) + } baseCtx, cancel := context.WithCancel(parent) defer cancel() extensions := make(chan time.Duration)