php-src/main
Max Kellermann 2d986310f1 streams/xp_socket: eliminate poll() when MSG_DONTWAIT is available
If there is a zero timeout and MSG_DONTWAIT is available (or the
socket is non-blocking), the poll() call is not necessary, and we can
just call recv() right away.

Before this change:

 poll([{fd=4, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 1, 0) = 0 (Timeout)
 poll([{fd=4, events=POLLIN|POLLERR|POLLHUP}], 1, 60000) = 1 ([{fd=4, revents=POLLIN}])
 recvfrom(4, "HTTP/1.1 301 Moved Permanently\r\n"..., 8192, MSG_DONTWAIT, NULL, NULL) = 348
 poll([{fd=4, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 1, 0) = 1 ([{fd=4, revents=POLLIN}])
 recvfrom(4, "", 1, MSG_PEEK, NULL, NULL) = 0

After this change:

 recvfrom(4, 0x7ffe0cc719a0, 1, MSG_PEEK|MSG_DONTWAIT, NULL, NULL) = -1 EAGAIN (Resource temporarily unavailable)
 poll([{fd=4, events=POLLIN|POLLERR|POLLHUP}], 1, 60000) = 1 ([{fd=4, revents=POLLIN}])
 recvfrom(4, "HTTP/1.1 301 Moved Permanently\r\n"..., 8192, MSG_DONTWAIT, NULL, NULL) = 348
 recvfrom(4, "", 1, MSG_PEEK|MSG_DONTWAIT, NULL, NULL) = 0

The first poll() is replaced by recvfrom(), and the third poll() is
omitted completely.

ext/openssl/xp_ssl: eliminate poll() when MSG_DONTWAIT is available

If there is a zero timeout and MSG_DONTWAIT is available (or the
socket is non-blocking), the poll() call is not necessary, and we can
just call recv() right away.

Closes GH-8092.
2022-06-18 19:44:32 +01:00
..
streams streams/xp_socket: eliminate poll() when MSG_DONTWAIT is available 2022-06-18 19:44:32 +01:00
build-defs.h.in Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
explicit_bzero.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
fastcgi.c Merge branch 'PHP-8.1' 2022-05-10 21:40:44 +01:00
fastcgi.h Mark various functions with void arguments. 2021-05-12 14:55:53 +01:00
fopen_wrappers.c Fix for bug in file handling refactor. 2021-11-23 18:34:48 +01:00
fopen_wrappers.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
getopt.c Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
http_status_codes.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
internal_functions_win32.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
internal_functions.c.in Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
main.c Deprecate zend_atol() / add zend_ini_parse_quantity() (#7951) 2022-06-17 14:12:53 +02:00
network.c Update bug tracker links 2022-05-12 14:55:11 +02:00
output.c Replace memcmp() with zend_string functions (#8216) 2022-03-31 16:27:58 +02:00
php_compat.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_content_types.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_content_types.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_getopt.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_globals.h Remove no longer used "log_errors_max_len" ini directive (#6838) 2021-05-10 19:26:33 +02:00
php_ini_builder.c sapi/*: move duplicate "--define" code to library 2022-04-18 16:52:08 +02:00
php_ini_builder.h sapi/*: move duplicate "--define" code to library 2022-04-18 16:52:08 +02:00
php_ini.c Initialise zend_stat_t to fix MSAN build 2022-05-22 16:06:27 +01:00
php_ini.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_main.h Minor refactoring of main/main.c and TSRM (#8608) 2022-05-24 08:34:55 +01:00
php_memory_streams.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_network.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_odbc_utils.c Quote when adding to connection string in (PDO_)ODBC 2022-05-27 16:56:44 +02:00
php_odbc_utils.h Quote when adding to connection string in (PDO_)ODBC 2022-05-27 16:56:44 +02:00
php_open_temporary_file.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_open_temporary_file.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_output.h Remove unnecessary PHP_FUNCTION() declarations (#7472) 2021-09-07 10:04:00 +02:00
php_reentrancy.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_scandir.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_scandir.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_streams.h Use more specific return type for stream functions 2021-09-20 14:24:59 +01:00
php_syslog.c Make syslog() binary safe 2021-07-15 19:08:26 +02:00
php_syslog.h Make syslog() binary safe 2021-07-15 19:08:26 +02:00
php_ticks.c Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
php_ticks.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_variables.c Replace memcmp() with zend_string functions (#8216) 2022-03-31 16:27:58 +02:00
php_variables.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_version.h Bump for 8.1.8-dev 2022-05-25 00:54:00 +02:00
php.h Replace php_stdint.h header with standard headers (#8613) 2022-05-29 11:20:56 +01:00
reentrancy.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
rfc1867.c Use more compact representation for packed arrays. 2021-11-03 15:18:26 +03:00
rfc1867.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
SAPI.c Allow get_request_time() hook to fail 2021-09-16 16:54:07 +02:00
SAPI.h Allow get_request_time() hook to fail 2021-09-16 16:54:07 +02:00
snprintf.c Use memrchr() when available 2021-11-24 16:13:34 +03:00
snprintf.h Remove FORMAT_CONV_MAX_PRECISION 2021-08-02 15:59:26 +02:00
spprintf.c Use memrchr() when available 2021-11-24 16:13:34 +03:00
spprintf.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
strlcat.c strlcpy/strlcat update to last openbsd version. 2022-04-28 15:09:55 +02:00
strlcpy.c strlcpy/strlcat update to last openbsd version. 2022-04-28 15:09:55 +02:00