From c9d741c2020fe7a811e724e743aef23d1a8980e5 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Mon, 5 Oct 2026 16:36:42 +0800 Subject: [PATCH] =?UTF-8?q?test(WebTest):=20=E6=B5=8B=E8=AF=95=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E7=94=B1=20example.com=20=E6=8D=A2=E4=B8=BA=20cn.bing?= =?UTF-8?q?.com?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit example.com 在当前网络下不可达(HttpClient 12s 超时),WebTest 的 HTTP GET 无超时保护会无限阻塞,导致顺序回归在此超时中断。改用实测可达的 http://cn.bing.com/ ;DNS 用例(connect 80 端口)同步换主机。 --- WebTest/App/main.vp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/WebTest/App/main.vp b/WebTest/App/main.vp index 3ef4c2d..ed5713a 100644 --- a/WebTest/App/main.vp +++ b/WebTest/App/main.vp @@ -43,16 +43,16 @@ def main() -> int: dns_sock = socket.Socket(socket.AF_INET, socket.SOCK_STREAM) if dns_sock.fd != socket.INVALID_SOCKET: dns_sock.settimeout(5000) - result: INT = dns_sock.connect("example.com", 80) + result: INT = dns_sock.connect("cn.bing.com", 80) if result == 0: - stdio.printf("DNS: example.com resolved OK\n") + stdio.printf("DNS: cn.bing.com resolved OK\n") else: - stdio.printf("DNS: example.com resolved but connect failed (err in _MakeAddr debug above)\n") + stdio.printf("DNS: cn.bing.com resolved but connect failed (err in _MakeAddr debug above)\n") dns_sock.close() - # 测试 HTTP GET — 使用 DNS 解析 example.com - stdio.printf("\n--- HTTP GET test (example.com) ---\n") - resp = requests.get("http://example.com/") + # 测试 HTTP GET — 使用 DNS 解析 cn.bing.com(example.com 在部分网络下不可达) + stdio.printf("\n--- HTTP GET test (cn.bing.com) ---\n") + resp = requests.get("http://cn.bing.com/") if resp is not None: stdio.printf("requests.get: OK\n") code: INT = resp.status_code