mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix #78919: CLI server: insufficient cleanup if request startup fails
We need to run the full `php_cli_server_request_shutdown()` in case of failing `php_cli_server_request_startup()`. Patch contributed by @cataphract. Closes GH-7322.
This commit is contained in:
parent
ef5558a8cd
commit
be2df43b08
2 changed files with 3 additions and 5 deletions
2
NEWS
2
NEWS
|
@ -9,6 +9,8 @@ PHP NEWS
|
|||
(krakjoe)
|
||||
. Fixed bug #81192 ("Declaration should be compatible with" gives incorrect
|
||||
line number with traits). (Nikita)
|
||||
. Fixed bug #78919 (CLI server: insufficient cleanup if request startup
|
||||
fails). (cataphract, cmb)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #79580 (date_create_from_format misses leap year). (Derick)
|
||||
|
|
|
@ -2126,8 +2126,6 @@ static int php_cli_server_request_startup(php_cli_server *server, php_cli_server
|
|||
}
|
||||
SG(sapi_headers).http_response_code = 200;
|
||||
if (FAILURE == php_request_startup()) {
|
||||
/* should never be happen */
|
||||
destroy_request_info(&SG(request_info));
|
||||
return FAILURE;
|
||||
}
|
||||
PG(during_request_startup) = 0;
|
||||
|
@ -2198,9 +2196,7 @@ static int php_cli_server_dispatch(php_cli_server *server, php_cli_server_client
|
|||
|
||||
if (server->router || !is_static_file) {
|
||||
if (FAILURE == php_cli_server_request_startup(server, client)) {
|
||||
SG(server_context) = NULL;
|
||||
php_cli_server_close_connection(server, client);
|
||||
destroy_request_info(&SG(request_info));
|
||||
php_cli_server_request_shutdown(server, client);
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue