From 5ceec6d58444ed69ccbbfa53d432b8172d3db45c Mon Sep 17 00:00:00 2001 From: MARiA so cute <33935209+NathanFreeman@users.noreply.github.com> Date: Wed, 11 Dec 2024 09:06:40 +0800 Subject: [PATCH] optimize config.m4 and remove dead code (#5611) --- config.m4 | 10 +++++++--- ext-src/swoole_http_request.cc | 4 ---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config.m4 b/config.m4 index ef61105a89..ada2e983ba 100644 --- a/config.m4 +++ b/config.m4 @@ -54,7 +54,7 @@ PHP_ARG_ENABLE([cares], PHP_ARG_ENABLE([iouring], [enable io-uring support], [AS_HELP_STRING([--enable-iouring], - [Enable io-uring (Experimental)])], [no], [no]) + [Enable io-uring])], [no], [no]) PHP_ARG_WITH([openssl_dir], [dir of openssl], @@ -994,10 +994,14 @@ EOF if test "$SW_OS" = "LINUX"; then GLIBC_VERSION=$(getconf GNU_LIBC_VERSION | awk '{print $2}') AC_MSG_NOTICE([glibc version: $GLIBC_VERSION]) - if [[ $(echo "$GLIBC_VERSION < 2.17" | bc -l) -eq 1 ]]; then + + GLIBC_MAJOR_VERSION=$(getconf GNU_LIBC_VERSION | awk '{print $2}' | cut -d '.' -f 1) + GLIBC_MINOR_VERSION=$(getconf GNU_LIBC_VERSION | awk '{print $2}' | cut -d '.' -f 2) + + if test $GLIBC_MAJOR_VERSION -lt 2 || (test $GLIBC_MAJOR_VERSION -eq 2 && test $GLIBC_MINOR_VERSION -lt 17); then OS_SHOULD_HAVE_LIBRT=1 else - AC_MSG_NOTICE([link with -lrt (only for glibc versions before 2.17)]) + AC_MSG_NOTICE([link with -lrt (only for glibc version before 2.17)]) OS_SHOULD_HAVE_LIBRT=0 fi elif test "$SW_OS" = "MAC"; then diff --git a/ext-src/swoole_http_request.cc b/ext-src/swoole_http_request.cc index 56da5845a9..184cb9f487 100644 --- a/ext-src/swoole_http_request.cc +++ b/ext-src/swoole_http_request.cc @@ -857,10 +857,6 @@ const char *HttpContext::get_content_encoding() { } #endif -static void swoole_request_read_fd_property(zend_object *object, HttpContext *ctx) { - zend_update_property_long(swoole_http_request_ce, object, ZEND_STRL("fd"), ctx->fd); -} - static PHP_METHOD(swoole_http_request, getContent) { HttpContext *ctx = php_swoole_http_request_get_and_check_context(ZEND_THIS); if (UNEXPECTED(!ctx)) {