Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 7 additions & 2 deletions .github/workflows/test-nginx-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ jobs:

# NOTE:
# For "-D T_NGX_MODIFY_DEFAULT_VALUE=0", we dont compile the source included in this macro, otherwise some nginx-tests cases tests will fail.
# For "-D T_NGX_SERVER_INFO=0", it made some cases (userid.t) passed.
./configure \
--with-cc-opt="-D T_NGX_MODIFY_DEFAULT_VALUE=0 -D T_NGX_HTTP_IMAGE_FILTER=0" \
--with-cc-opt="-D T_NGX_MODIFY_DEFAULT_VALUE=0 -D T_NGX_HTTP_IMAGE_FILTER=0 -D T_NGX_SERVER_INFO=0" \
--with-ld-opt="-Wl,-rpath,/usr/local/lib" \
--with-openssl-async \
--with-pcre \
Expand Down Expand Up @@ -84,7 +85,6 @@ jobs:
--add-module=modules/mod_config \
--add-module=modules/mod_dubbo \
--add-module=modules/ngx_backtrace_module \
--add-module=modules/ngx_debug_pool \
--add-module=modules/ngx_debug_timer \
--add-module=modules/ngx_http_concat_module \
--add-module=modules/ngx_http_footer_filter_module \
Expand All @@ -106,6 +106,7 @@ jobs:
--with-stream_sni \
--with-openssl-async \
--with-debug
# skip ngx_debug_pool, it modified NGX_MIN_POOL_SIZE, which made some test case failed (http_header_buffers.t)
# skip tengine upstream keepalive module
#--without-http_upstream_keepalive_module \
#--add-module=modules/ngx_http_upstream_keepalive_module \
Expand All @@ -119,7 +120,11 @@ jobs:
TEST_NGINX_BINARY: /usr/local/nginx/sbin/nginx
TEST_NGINX_UNSAFE: yes
run: |
# prepare perl library for test case
sudo cpanm --notest SCGI Protocol::WebSocket Net::SSLeay IO::Socket::SSL Cache::Memcached Cache::Memcached::Fast Net::DNS::Nameserver GD > build.log 2>&1 || (cat build.log && exit 1)
# fixed http_method.t for tengine proxy_connect module
sed -i -e "s+405 Not Allowed(?!.*200 OK)/s, 'connect'+400 Bad Request(?!.*200 OK)/s, 'connect'+" nginx-tests/http_method.t
# run cases in nginx-tests
prove -I nginx-tests/lib nginx-tests/
# It must be root for some cases.
sudo groupadd wheel # for proxy_bind_transparent.t
Expand Down
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Tengine has been an open source project since December 2011. It is being activel
Features
========

* All features of nginx-1.18.0 are inherited, i.e., it is 100% compatible with nginx.
* All features of nginx-1.22.1 are inherited, i.e., it is 100% compatible with nginx.
* Support the CONNECT HTTP method for forward proxy.
* Support asynchronous OpenSSL, using hardware such as QAT for HTTPS acceleration.
* Enhanced operations monitoring, such as asynchronous log & rollback, DNS caching, memory usage, etc.
Expand Down
4 changes: 4 additions & 0 deletions auto/configure
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ have=NGX_PID_PATH value="\"$NGX_PID_PATH\"" . auto/define
have=NGX_LOCK_PATH value="\"$NGX_LOCK_PATH\"" . auto/define
have=NGX_ERROR_LOG_PATH value="\"$NGX_ERROR_LOG_PATH\"" . auto/define

if [ ".$NGX_ERROR_LOG_PATH" = "." ]; then
have=NGX_ERROR_LOG_STDERR . auto/have
fi

have=NGX_HTTP_LOG_PATH value="\"$NGX_HTTP_LOG_PATH\"" . auto/define
have=NGX_HTTP_CLIENT_TEMP_PATH value="\"$NGX_HTTP_CLIENT_TEMP_PATH\""
. auto/define
Expand Down
2 changes: 2 additions & 0 deletions auto/init
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ default: build

clean:
rm -rf Makefile $NGX_OBJS

.PHONY: default clean
END
3 changes: 2 additions & 1 deletion auto/install
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ build:
install:
\$(MAKE) -f $NGX_MAKEFILE install

.PHONY: modules
modules:
\$(MAKE) -f $NGX_MAKEFILE modules

Expand All @@ -216,4 +215,6 @@ upgrade:
test -f $NGX_PID_PATH.oldbin

kill -QUIT \`cat $NGX_PID_PATH.oldbin\`

.PHONY: build install modules upgrade
END
13 changes: 7 additions & 6 deletions auto/make
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ $ngx_obj: \$(CORE_DEPS) \$(HTTP_DEPS)$ngx_cont$ngx_src
END

fi
done
done

fi

Expand Down Expand Up @@ -347,7 +347,7 @@ $ngx_obj: \$(CORE_DEPS) \$(MAIL_DEPS)$ngx_cont$ngx_src
$ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX

END
done
done

fi

Expand Down Expand Up @@ -377,7 +377,7 @@ $ngx_obj: \$(CORE_DEPS) \$(STREAM_DEPS)$ngx_cont$ngx_src
$ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX

END
done
done

fi

Expand All @@ -403,7 +403,7 @@ $ngx_obj: \$(CORE_DEPS) $ngx_cont$ngx_src
$ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX

END
done
done

fi

Expand Down Expand Up @@ -435,7 +435,7 @@ $ngx_obj: \$(ADDON_DEPS)$ngx_cont$ngx_src
$ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX

END
done
done

fi

Expand Down Expand Up @@ -506,6 +506,7 @@ fi
for ngx_module in $DYNAMIC_MODULES
do
eval ngx_module_srcs="\$${ngx_module}_SRCS"
eval ngx_module_shrd="\$${ngx_module}_SHRD"
eval eval ngx_module_libs="\\\"\$${ngx_module}_LIBS\\\""

eval ngx_module_modules="\$${ngx_module}_MODULES"
Expand Down Expand Up @@ -571,7 +572,7 @@ END
| sed -e "s/\(.*\.\)c/\1$ngx_objext/"`

ngx_module_objs=
for ngx_src in $ngx_module_srcs
for ngx_src in $ngx_module_srcs $ngx_module_shrd
do
case "$ngx_src" in
src/*)
Expand Down
44 changes: 42 additions & 2 deletions auto/module
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ if [ "$ngx_module_link" = DYNAMIC ]; then
done

DYNAMIC_MODULES="$DYNAMIC_MODULES $ngx_module"
eval ${ngx_module}_SRCS=\"$ngx_module_srcs\"

eval ${ngx_module}_MODULES=\"$ngx_module_name\"

Expand All @@ -31,6 +30,30 @@ if [ "$ngx_module_link" = DYNAMIC ]; then
eval ${ngx_module}_ORDER=\"$ngx_module_order\"
fi

srcs=
shrd=
for src in $ngx_module_srcs
do
found=no
for old in $DYNAMIC_MODULES_SRCS
do
if [ $src = $old ]; then
found=yes
break
fi
done

if [ $found = no ]; then
srcs="$srcs $src"
else
shrd="$shrd $src"
fi
done
eval ${ngx_module}_SRCS=\"$srcs\"
eval ${ngx_module}_SHRD=\"$shrd\"

DYNAMIC_MODULES_SRCS="$DYNAMIC_MODULES_SRCS $srcs"

if test -n "$ngx_module_incs"; then
CORE_INCS="$CORE_INCS $ngx_module_incs"
fi
Expand Down Expand Up @@ -107,7 +130,24 @@ elif [ "$ngx_module_link" = ADDON ]; then
eval ${ngx_module_type}_MODULES=\"\$${ngx_module_type}_MODULES \
$ngx_module_name\"

NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_module_srcs"
srcs=
for src in $ngx_module_srcs
do
found=no
for old in $NGX_ADDON_SRCS
do
if [ $src = $old ]; then
found=yes
break
fi
done

if [ $found = no ]; then
srcs="$srcs $src"
fi
done

NGX_ADDON_SRCS="$NGX_ADDON_SRCS $srcs"

if test -n "$ngx_module_incs"; then
eval ${ngx_var}_INCS=\"\$${ngx_var}_INCS $ngx_module_incs\"
Expand Down
23 changes: 21 additions & 2 deletions auto/modules
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ if [ $HTTP = YES ]; then
fi


if [ $HTTP_V2 = YES ]; then
HTTP_SRCS="$HTTP_SRCS $HTTP_HUFF_SRCS"
fi


# the module order is important
# ngx_http_static_module
# ngx_http_gzip_static_module
Expand Down Expand Up @@ -425,8 +430,6 @@ if [ $HTTP = YES ]; then
ngx_module_srcs="src/http/v2/ngx_http_v2.c \
src/http/v2/ngx_http_v2_table.c \
src/http/v2/ngx_http_v2_encode.c \
src/http/v2/ngx_http_v2_huff_decode.c \
src/http/v2/ngx_http_v2_huff_encode.c \
src/http/v2/ngx_http_v2_module.c"
ngx_module_libs=
ngx_module_link=$HTTP_V2
Expand Down Expand Up @@ -1004,6 +1007,12 @@ if [ $MAIL != NO ]; then
ngx_module_srcs=src/mail/ngx_mail_proxy_module.c

. auto/module

ngx_module_name=ngx_mail_realip_module
ngx_module_deps=
ngx_module_srcs=src/mail/ngx_mail_realip_module.c

. auto/module
fi


Expand Down Expand Up @@ -1138,6 +1147,16 @@ if [ $STREAM != NO ]; then
. auto/module
fi

if [ $STREAM_SET = YES ]; then
ngx_module_name=ngx_stream_set_module
ngx_module_deps=
ngx_module_srcs=src/stream/ngx_stream_set_module.c
ngx_module_libs=
ngx_module_link=$STREAM_SET

. auto/module
fi

if [ $STREAM_UPSTREAM_HASH = YES ]; then
ngx_module_name=ngx_stream_upstream_hash_module
ngx_module_deps=
Expand Down
6 changes: 6 additions & 0 deletions auto/options
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,10 @@ STREAM_SSL_PREREAD=NO
STREAM_SNI=NO

DYNAMIC_MODULES=
DYNAMIC_MODULES_SRCS=

NGX_ADDONS=
NGX_ADDON_SRCS=
NGX_ADDON_DEPS=
DYNAMIC_ADDONS=

Expand All @@ -150,6 +152,7 @@ PCRE=NONE
PCRE_OPT=
PCRE_CONF_OPT=
PCRE_JIT=NO
PCRE2=YES

USE_OPENSSL=NO
OPENSSL=NONE
Expand Down Expand Up @@ -380,6 +383,7 @@ use the \"--with-mail_ssl_module\" option instead"
--with-pcre=*) PCRE="$value" ;;
--with-pcre-opt=*) PCRE_OPT="$value" ;;
--with-pcre-jit) PCRE_JIT=YES ;;
--without-pcre2) PCRE2=DISABLED ;;

--with-openssl=*) OPENSSL="$value" ;;
--with-openssl-opt=*) OPENSSL_OPT="$value" ;;
Expand Down Expand Up @@ -582,6 +586,7 @@ cat << END
--without-stream_split_clients_module
disable ngx_stream_split_clients_module
--without-stream_return_module disable ngx_stream_return_module
--without-stream_set_module disable ngx_stream_set_module
--without-stream_upstream_hash_module
disable ngx_stream_upstream_hash_module
--without-stream_upstream_least_conn_module
Expand Down Expand Up @@ -612,6 +617,7 @@ cat << END
--with-pcre=DIR set path to PCRE library sources
--with-pcre-opt=OPTIONS set additional build options for PCRE
--with-pcre-jit build PCRE with JIT compilation support
--without-pcre2 do not use PCRE2 library

--with-zlib=DIR set path to zlib library sources
--with-zlib-opt=OPTIONS set additional build options for zlib
Expand Down
8 changes: 3 additions & 5 deletions auto/os/freebsd
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,10 @@ if [ $osreldate -gt 300007 ]; then
CORE_SRCS="$CORE_SRCS $FREEBSD_SENDFILE_SRCS"
fi

if [ $NGX_FILE_AIO = YES ]; then
if [ $osreldate -gt 502103 ]; then
echo " + sendfile()'s SF_NODISKIO found"
if [ $osreldate -gt 1100093 ]; then
echo " + sendfile()'s SF_NODISKIO found"

have=NGX_HAVE_AIO_SENDFILE . auto/have
fi
have=NGX_HAVE_SENDFILE_NODISKIO . auto/have
fi

# POSIX semaphores
Expand Down
25 changes: 25 additions & 0 deletions auto/os/linux
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,31 @@ if [ $ngx_found = yes ]; then
ee.data.ptr = NULL;
epoll_ctl(efd, EPOLL_CTL_ADD, fd, &ee)"
. auto/feature


# eventfd()

ngx_feature="eventfd()"
ngx_feature_name="NGX_HAVE_EVENTFD"
ngx_feature_run=no
ngx_feature_incs="#include <sys/eventfd.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="(void) eventfd(0, 0)"
. auto/feature

if [ $ngx_found = yes ]; then
have=NGX_HAVE_SYS_EVENTFD_H . auto/have
fi


if [ $ngx_found = no ]; then

ngx_feature="eventfd() (SYS_eventfd)"
ngx_feature_incs="#include <sys/syscall.h>"
ngx_feature_test="(void) SYS_eventfd"
. auto/feature
fi
fi


Expand Down
3 changes: 2 additions & 1 deletion auto/sources
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ NGX_WIN32_RC="src/os/win32/nginx.rc"

HTTP_FILE_CACHE_SRCS=src/http/ngx_http_file_cache.c


HTTP_HUFF_SRCS="src/http/ngx_http_huff_decode.c
src/http/ngx_http_huff_encode.c"

NGX_HTTP_LUA_MODULE=ngx_http_lua_module
NGX_HTTP_LUA_MODULE_SRCS="modules/ngx_http_lua_module/src/ngx_http_lua_script.c \
Expand Down
4 changes: 2 additions & 2 deletions auto/summary
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ if [ $USE_PCRE = DISABLED ]; then

else
case $PCRE in
YES) echo " + using system PCRE library" ;;
YES) echo " + using system $PCRE_LIBRARY library" ;;
NONE) echo " + PCRE library is not used" ;;
*) echo " + using PCRE library: $PCRE" ;;
*) echo " + using $PCRE_LIBRARY library: $PCRE" ;;
esac
fi

Expand Down
Loading