-
-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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 <[email protected]> * Update frankenphp_test.go Co-authored-by: Kévin Dunglas <[email protected]> --------- Co-authored-by: Alliballibaba <[email protected]> Co-authored-by: Kévin Dunglas <[email protected]>
- Loading branch information
1 parent
eee1de1
commit 05aafc7
Showing
5 changed files
with
68 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
word1word2word3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters