Patch cli_no_exit.diff for Built-in web server Bug #78919
Patch version 2019-12-06 14:43 UTC
Return to Bug #78919 |
Download this patch
Patch Revisions:
Developer: contratempo@gmail.com
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index cdcd93ac72..53e734f1ba 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -2072,8 +2072,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;
@@ -2144,9 +2142,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;
}
}
|