mirror of
https://github.com/php/php-src.git
synced 2024-11-27 03:44:07 +08:00
69dee5c732
Directly listen on socket, instead of duping it to STDIN and listening on that.
47 lines
795 B
PHP
47 lines
795 B
PHP
--TEST--
|
|
FPM: bug73342 - Non-blocking stdin
|
|
--SKIPIF--
|
|
<?php include "skipif.inc"; ?>
|
|
--FILE--
|
|
<?php
|
|
|
|
require_once "tester.inc";
|
|
|
|
$cfg = <<<EOT
|
|
[global]
|
|
error_log = {{FILE:LOG}}
|
|
[unconfined]
|
|
listen = {{ADDR}}
|
|
pm = dynamic
|
|
pm.max_children = 5
|
|
pm.start_servers = 1
|
|
pm.min_spare_servers = 1
|
|
pm.max_spare_servers = 3
|
|
EOT;
|
|
|
|
$code = <<<EOT
|
|
<?php
|
|
echo "Before\n";
|
|
stream_set_blocking(fopen('php://stdin', 'r'), false);
|
|
echo "After\n";
|
|
EOT;
|
|
|
|
$tester = new FPM\Tester($cfg, $code);
|
|
$tester->start();
|
|
$tester->expectLogStartNotices();
|
|
$tester->request()->expectBody("Before\nAfter");
|
|
$tester->request()->expectBody("Before\nAfter");
|
|
$tester->terminate();
|
|
$tester->expectLogTerminatingNotices();
|
|
$tester->close();
|
|
|
|
?>
|
|
Done
|
|
--EXPECT--
|
|
Done
|
|
--CLEAN--
|
|
<?php
|
|
require_once "tester.inc";
|
|
FPM\Tester::clean();
|
|
?>
|