Browse Source
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
Treat accept failing with SOCK_EAGAIN as success in CLI web server
pull/20098/head
Ilija Tovilo
6 days ago
No known key found for this signature in database
GPG Key ID: 115CEA7A713E12E9
2 changed files with
9 additions and
3 deletions
-
NEWS
-
sapi/cli/php_cli_server.c
|
|
@ -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) |
|
|
|
|
|
@ -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)) { |
|
|
|