1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.3' into PHP-8.4

* PHP-8.3:
  Treat accept failing with SOCK_EAGAIN as success in CLI web server
This commit is contained in:
Ilija Tovilo
2025-10-06 14:20:12 +02:00
2 changed files with 9 additions and 3 deletions

4
NEWS
View File

@@ -16,6 +16,10 @@ PHP NEWS
configured). (nielsdos)
. Fixed bug GH-20002 (Broken build on *BSD with MSAN). (outtersg)
- CLI:
. Fix useless "Failed to poll event" error logs due to EAGAIN in CLI server
with PHP_CLI_SERVER_WORKERS. (leotaku)
- Curl:
. Fix cloning of CURLOPT_POSTFIELDS when using the clone operator instead
of the curl_copy_handle() function to clone a CurlHandle. (timwolla)

View File

@@ -2711,14 +2711,16 @@ static zend_result php_cli_server_do_event_for_each_fd_callback(void *_params, p
struct sockaddr *sa = pemalloc(server->socklen, 1);
client_sock = accept(server->server_sock, sa, &socklen);
if (!ZEND_VALID_SOCKET(client_sock)) {
int err = php_socket_errno();
if (err != SOCK_EAGAIN && php_cli_server_log_level >= PHP_CLI_SERVER_LOG_ERROR) {
pefree(sa, 1);
if (php_socket_errno() == SOCK_EAGAIN) {
return SUCCESS;
}
if (php_cli_server_log_level >= PHP_CLI_SERVER_LOG_ERROR) {
char *errstr = php_socket_strerror(php_socket_errno(), NULL, 0);
php_cli_server_logf(PHP_CLI_SERVER_LOG_ERROR,
"Failed to accept a client (reason: %s)", errstr);
efree(errstr);
}
pefree(sa, 1);
return FAILURE;
}
if (SUCCESS != php_set_sock_blocking(client_sock, 0)) {