mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
2d986310f1
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. |
||
---|---|---|
.. | ||
streams | ||
build-defs.h.in | ||
explicit_bzero.c | ||
fastcgi.c | ||
fastcgi.h | ||
fopen_wrappers.c | ||
fopen_wrappers.h | ||
getopt.c | ||
http_status_codes.h | ||
internal_functions_win32.c | ||
internal_functions.c.in | ||
main.c | ||
network.c | ||
output.c | ||
php_compat.h | ||
php_content_types.c | ||
php_content_types.h | ||
php_getopt.h | ||
php_globals.h | ||
php_ini_builder.c | ||
php_ini_builder.h | ||
php_ini.c | ||
php_ini.h | ||
php_main.h | ||
php_memory_streams.h | ||
php_network.h | ||
php_odbc_utils.c | ||
php_odbc_utils.h | ||
php_open_temporary_file.c | ||
php_open_temporary_file.h | ||
php_output.h | ||
php_reentrancy.h | ||
php_scandir.c | ||
php_scandir.h | ||
php_streams.h | ||
php_syslog.c | ||
php_syslog.h | ||
php_ticks.c | ||
php_ticks.h | ||
php_variables.c | ||
php_variables.h | ||
php_version.h | ||
php.h | ||
reentrancy.c | ||
rfc1867.c | ||
rfc1867.h | ||
SAPI.c | ||
SAPI.h | ||
snprintf.c | ||
snprintf.h | ||
spprintf.c | ||
spprintf.h | ||
strlcat.c | ||
strlcpy.c |