sse : Ping was buffered and not sent until a valid entry is sent

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@6063 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2020-08-31 14:31:03 +00:00
parent 6e846514c6
commit c136fb4a40

10
sse.php
View File

@@ -172,17 +172,17 @@ class sse
}
echo "$event: ".implode ("\n$event: ", explode ("\n", rtrim ($data))).
"\n\n";
if (! defined ("PHPUNIT"))
{
@ob_end_flush();
@flush();
}
}
if (defined ("PHPUNIT"))
{
$testloop--;
pcntl_signal_dispatch();
}
else
{
@ob_end_flush();
@flush();
}
// Loop each 100ms if there is no data.
usleep(100000);
}