From cf12c216dc7bd380ca4ddc41973742846979ff8d Mon Sep 17 00:00:00 2001 From: shimon Date: Wed, 30 Jul 2025 15:11:56 +0300 Subject: [PATCH] Fix coroutine check in Client class to handle negative CIDs correctly --- src/Client.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Client.php b/src/Client.php index 014624c994..9f7ef2ee2d 100644 --- a/src/Client.php +++ b/src/Client.php @@ -9,8 +9,6 @@ use Swoole\Coroutine\Client as CoroutineClient; use stdClass; use Swoole\Coroutine; - - class Client { /** @@ -92,7 +90,7 @@ class Client if ($useCoroutine) { try { $cid = \Swoole\Coroutine::getCid(); - if ($cid === false || $cid === 0) { + if ($cid === false || $cid < 0) { $useCoroutine = false; } } catch (\Throwable $e) {