From 66aefb3136f42ae78aa41ae3dcf72b5934f8ab22 Mon Sep 17 00:00:00 2001 From: Dmitrii Derepko Date: Sun, 7 Jul 2024 07:37:25 +0300 Subject: [PATCH] Release if connection is aborted --- src/Inspector/Controller/DebugServerController.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Inspector/Controller/DebugServerController.php b/src/Inspector/Controller/DebugServerController.php index 2a3adb7..8bd9216 100644 --- a/src/Inspector/Controller/DebugServerController.php +++ b/src/Inspector/Controller/DebugServerController.php @@ -34,13 +34,16 @@ public function stream( switch ($message[0]) { case Connection::TYPE_ERROR: return ''; - default: + case Connection::TYPE_RELEASE: /** * Break the loop if the client aborted the connection (closed the page) */ if (connection_aborted()) { - return $message[1]; + return ''; } + break; + case Connection::TYPE_RESULT: + yield $message[1]; } }