mirror of
https://github.com/dunglas/frankenphp.git
synced 2025-12-24 13:38:11 +08:00
* fix a memory leak on thread shutdown * clean up unused resources at end of request * try the obvious * Test * clang-format * Also ignores persistent streams. * Adds stream test. * Moves clean up function to frankenphp_worker_request_shutdown. * Fixes test on -nowatcher * Fixes test on -nowatcher * Update testdata/file-stream.txt Co-authored-by: Kévin Dunglas <kevin@dunglas.fr> * Update frankenphp_test.go Co-authored-by: Kévin Dunglas <kevin@dunglas.fr> --------- Co-authored-by: Alliballibaba <alliballibaba@gmail.com> Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
14 lines
358 B
PHP
14 lines
358 B
PHP
<?php
|
|
|
|
$fileStream = fopen(__DIR__ . '/file-stream.txt', 'r');
|
|
$input = fopen('php://input', 'r');
|
|
|
|
while (frankenphp_handle_request(function () use ($fileStream, $input) {
|
|
echo fread($fileStream, 5);
|
|
|
|
// this line will lead to a zend_mm_heap corrupted error if the input stream was destroyed
|
|
stream_is_local($input);
|
|
})) ;
|
|
|
|
fclose($fileStream);
|