mirror of
https://github.com/php/php-src.git
synced 2026-04-21 23:18:13 +02:00
3503b1daa2
This change primarily splits SAPI deactivation to module and destroy parts. The reason is that currently some SAPIs might bail out on deactivation. One of those SAPI is PHP-FPM that can bail out on request end if for example the connection is closed by the client (web sever). The problem is that in such case the resources are not freed and some values reset. The most visible impact can have not resetting the PG(headers_sent) which can cause erorrs in the next request. One such issue is described in #77780 bug which this fixes and is also cover by a test in this commit. It seems reasonable to separate deactivation and destroying of the resource which means that the bail out will not impact it.
55 lines
886 B
PHP
55 lines
886 B
PHP
--TEST--
|
|
FPM: bug77780 - Headers already sent error incorrectly emitted
|
|
--SKIPIF--
|
|
<?php include "skipif.inc"; ?>
|
|
--EXTENSIONS--
|
|
session
|
|
--FILE--
|
|
<?php
|
|
|
|
require_once "tester.inc";
|
|
|
|
$cfg = <<<EOT
|
|
[global]
|
|
error_log = {{FILE:LOG}}
|
|
[unconfined]
|
|
listen = {{ADDR}}
|
|
pm = static
|
|
pm.max_children = 1
|
|
EOT;
|
|
|
|
$code = <<<EOT
|
|
<?php
|
|
echo str_repeat('asdfghjkl', 150000) . "\n";
|
|
EOT;
|
|
|
|
$tester = new FPM\Tester($cfg, $code);
|
|
$tester->start();
|
|
$tester->expectLogStartNotices();
|
|
$tester
|
|
->request(
|
|
headers: [
|
|
'PHP_VALUE' => "session.cookie_secure=1",
|
|
],
|
|
readLimit: 10,
|
|
expectError: true
|
|
);
|
|
$tester->request(
|
|
headers: [
|
|
'PHP_VALUE' => "session.cookie_secure=1",
|
|
]
|
|
)
|
|
->expectNoError();
|
|
$tester->terminate();
|
|
$tester->close();
|
|
|
|
?>
|
|
Done
|
|
--EXPECT--
|
|
Done
|
|
--CLEAN--
|
|
<?php
|
|
require_once "tester.inc";
|
|
FPM\Tester::clean();
|
|
?>
|