Skip to content

Commit 33b4748

Browse files
committed
update feature
AIO Thread support old version 1.10
1 parent 35a8f8f commit 33b4748

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

config

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,37 @@ fi
5454
# have=NGX_HTTP_C_FUN_SSL . auto/have
5555
# fi
5656

57+
# with dlfcn feature
58+
ngx_feature="ngx_http_c_func_compatibility"
59+
ngx_feature_name="NGX_HAVE_HTTP_C_FUNC_COMPATIBLITY"
60+
ngx_feature_run=no
61+
ngx_feature_incs="#include <dlfcn.h>"
62+
ngx_feature_path=
63+
ngx_feature_libs="-ldl"
64+
# ngx_feature_exit_if_not_found=yes
65+
ngx_feature_test="void * pt = dlopen(NULL, RTLD_LAZY | RTLD_NOW);"
66+
. auto/feature
67+
68+
if [ $ngx_found != yes ]; then
69+
echo "nginx version not support this module, please make sure nginx version is 1.10 and above"
70+
echo
71+
exit 1
72+
fi
73+
5774

5875
if test -n "$ngx_module_link"; then
5976
ngx_module_type=HTTP
6077
ngx_module_name=$ngx_addon_name
6178
ngx_module_deps="$HTTP_C_FUNC_DEPS"
6279
ngx_module_srcs="$HTTP_C_FUNC_SRCS"
6380
#ngx_module_libs=" -rdynamic -ldl -lpthread -lpcre -Wl,-E"
64-
ngx_module_libs="-ldl -lm -lpthread -lpcre"
81+
# ngx_module_libs="-ldl"
6582
#ngx_module_libs="-lunwind-coredump -lunwind-generic -lunwind-ptrace -lunwind"
6683

6784
. auto/module
6885
else
86+
# CORE_INCS="$CORE_INCS $ngx_feature_path"
87+
# CORE_LIBS="$CORE_LIBS -ldl"
6988
HTTP_MODULES="$HTTP_MODULES ngx_http_c_func_module"
7089
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $HTTP_C_FUNC_SRCS"
7190
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $HTTP_C_FUNC_DEPS"

src/ngx_http_c_func_module.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,11 @@ ngx_http_c_func_post_configuration(ngx_conf_t *cf) {
554554
static ngx_int_t
555555
ngx_http_c_func_pre_configuration(ngx_conf_t *cf) {
556556

557+
#if (nginx_version < 1010003)
558+
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%s", "nginx-c-function is not support nginx version below 1.10");
559+
return NGX_ERROR;
560+
#endif
561+
557562
#ifndef ngx_http_c_func_module_version_11
558563
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%s", "the latest ngx_http_c_func_module.h not found in the c header path, \
559564
please copy latest ngx_http_c_func_module.h to your /usr/include or /usr/local/include or relavent header search path \
@@ -1110,7 +1115,7 @@ ngx_http_c_func_precontent_handler(ngx_http_request_t *r) {
11101115
return NGX_DECLINED;
11111116
}
11121117
ngx_http_c_func_output_filter(r);
1113-
1118+
11141119
return NGX_DONE;
11151120
} /* ngx_http_c_func_precontent_handler */
11161121

0 commit comments

Comments
 (0)