From 8ba131aa860697a06edc80292fa9c11cbe536315 Mon Sep 17 00:00:00 2001 From: Yurun Date: Wed, 17 Jan 2024 09:39:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20Swoole=20HttpClient=20?= =?UTF-8?q?=E9=87=8D=E5=90=AF=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/YurunHttp.php | 2 +- src/YurunHttp/Handler/Swoole.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/YurunHttp.php b/src/YurunHttp.php index f1ab98f..54f40d4 100644 --- a/src/YurunHttp.php +++ b/src/YurunHttp.php @@ -24,7 +24,7 @@ abstract class YurunHttp /** * 版本号. */ - const VERSION = '4.3'; + const VERSION = '5.0'; /** * 设置默认处理器类. diff --git a/src/YurunHttp/Handler/Swoole.php b/src/YurunHttp/Handler/Swoole.php index 251a74e..23224d6 100644 --- a/src/YurunHttp/Handler/Swoole.php +++ b/src/YurunHttp/Handler/Swoole.php @@ -408,8 +408,8 @@ public function recvDefer($request, $timeout = null) } else { - // 状态码为5XX或者0才需要重试 - $retry = (0 === $statusCode || (5 === (int) ($statusCode / 100))); + // 状态码为5XX或者<0才需要重试 + $retry = ($statusCode <= 0 || (5 === (int) ($statusCode / 100))); } if ($retry) {