Skip to content

Commit

Permalink
optimize config.m4 and remove dead code (#5611)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFreeman authored Dec 11, 2024
1 parent 67ad28a commit 5ceec6d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 7 additions & 3 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions ext-src/swoole_http_request.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 5ceec6d

Please sign in to comment.