Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support nginx-1.21.1+ #196

Merged
merged 4 commits into from Oct 22, 2021
Merged

Support nginx-1.21.1+ #196

merged 4 commits into from Oct 22, 2021

Conversation

levonet
Copy link
Contributor

@levonet levonet commented Jul 24, 2021

close #193

@russian-developer
Copy link

cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules
-o objs/src/http/ngx_http.o
src/http/ngx_http.c
cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules
-o objs/src/http/ngx_http_core_module.o
src/http/ngx_http_core_module.c
src/http/ngx_http_core_module.c: In function ‘ngx_http_core_find_config_phase’:
src/http/ngx_http_core_module.c:961:22: error: ‘NGX_HTTP_CONNECT’ undeclared (first use in this function); did you mean ‘NGX_HTTP_CONFLICT’?
if (r->method == NGX_HTTP_CONNECT) {
^~~~~~~~~~~~~~~~
NGX_HTTP_CONFLICT
src/http/ngx_http_core_module.c:961:22: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [objs/Makefile:851: objs/src/http/ngx_http_core_module.o] Error 1
make[1]: Leaving directory '/usr/src/nginx-1.20.1'
make: *** [Makefile:10: build] Error 2

@levonet
Copy link
Contributor Author

levonet commented Aug 23, 2021

Hi, this patch can only be applied to version 1.21.1 and above.
For nginx-1.20.1 try to use proxy_connect_rewrite_1018.patch

@levonet
Copy link
Contributor Author

levonet commented Aug 23, 2021

@chobits Hi, can you look at these changes?

@pratikbin
Copy link

Waiting for this to get merged

@chobits
Copy link
Owner

chobits commented Oct 22, 2021

hi @levonet

Thank you for ur patch!

Need ur test case result: https://github.com/chobits/ngx_http_proxy_connect_module/wiki/How-to-run-test-case%3F

I have understand the problem , let me check and run test

@chobits
Copy link
Owner

chobits commented Oct 22, 2021

Without lua-module installed, test case passed.

DESKTOP-CQEO1JN work $ sh ngx_http_proxy_connect_module/t/runtest.sh
/home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect.t ............/home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect.t ............/home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect.t .................... 18/?   (in cleanup)    (in cleanup)  at /usr/share/perl/5.30/Test2/API.pm line 174 during global destruction.
                                                                                     /home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect.t .................... ok
/home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_lua.t ........                                                                                     /home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_lua.t ................ skipped: no lua available
/home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_resolve_variab/home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_resolve_variables.t .. 1/?    (in cleanup)    (in cleanup)  at /usr/share/perl/5.30/Test2/API.pm line 174 during global destruction.
                                                                                     /home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_resolve_variables.t .. ok
/home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_timeout.t ..../home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_timeout.t ............ 1/?    (in cleanup)    (in cleanup)  at /usr/share/perl/5.30/Test2/API.pm line 174 during global destruction.
                                                                                     /home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_timeout.t ............ ok
All tests successful.

Test Summary Report
-------------------
/home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_resolve_variables.t (Wstat: 0 Tests: 6 Failed: 0)
  TODO passed:   1-2
/home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_timeout.t          (Wstat: 0 Tests: 5 Failed: 0)
  TODO passed:   1-3
Files=4, Tests=33,  3 wallclock secs ( 0.03 usr  0.00 sys +  0.35 cusr  0.53 csys =  0.91 CPU)
Result: PASS

@chobits
Copy link
Owner

chobits commented Oct 22, 2021

After installing lua-nginx-module & lua-resty-core & lua-lrucache, the test case passed.
It's so hard to fix lua-nginx-module installation for nginx .

DESKTOP-CQEO1JN work $ sh ngx_http_proxy_connect_module/t/runtest.sh
/home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect.t .................... nginx: [warn] lua_load_resty_core is deprecated (the lua-resty-core library is required since ngx_lua v0.10.16) in /tmp/nginx-test-RGVTh4KITp/nginx.conf:20
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
/home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect.t .................... 1/? nginx: [warn] lua_load_resty_core is deprecated (the lua-resty-core library is required since ngx_lua v0.10.16) in /tmp/nginx-test-RGVTh4KITp/nginx.conf:20
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
nginx: [warn] lua_load_resty_core is deprecated (the lua-resty-core library is required since ngx_lua v0.10.16) in /tmp/nginx-test-RGVTh4KITp/nginx.conf:20
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
/home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect.t .................... 16/? nginx: [warn] lua_load_resty_core is deprecated (the lua-resty-core library is required since ngx_lua v0.10.16) in /tmp/nginx-test-RGVTh4KITp/nginx.conf:20
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
nginx: [warn] lua_load_resty_core is deprecated (the lua-resty-core library is required since ngx_lua v0.10.16) in /tmp/nginx-test-RGVTh4KITp/nginx.conf:20
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
        (in cleanup)    (in cleanup)  at /usr/share/perl/5.30/Test2/API.pm line 174 during global destruction.
                                                                                     /home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect.t .................... ok
/home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_lua.t ................ nginx: [warn] lua_load_resty_core is deprecated (the lua-resty-core library is required since ngx_lua v0.10.16) in /tmp/nginx-test-tq9ha0swJm/nginx.conf:21
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
/home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_lua.t ................ 1/?    (in cleanup)    (in cleanup)  at /usr/share/perl/5.30/Test2/API.pm line 174 during global destruction.
                                                                                     /home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_lua.t ................ ok
/home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_resolve_variables.t .. nginx: [warn] lua_load_resty_core is deprecated (the lua-resty-core library is required since ngx_lua v0.10.16) in /tmp/nginx-test-9LrzA6xMmN/nginx.conf:21
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
/home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_resolve_variables.t .. 1/?    (in cleanup)    (in cleanup)  at /usr/share/perl/5.30/Test2/API.pm line 174 during global destruction.
                                                                                     /home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_resolve_variables.t .. ok
/home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_timeout.t ............ nginx: [warn] lua_load_resty_core is deprecated (the lua-resty-core library is required since ngx_lua v0.10.16) in /tmp/nginx-test-cy2tXhlAtH/nginx.conf:21
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
/home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_timeout.t ............ 1/?    (in cleanup)    (in cleanup)  at /usr/share/perl/5.30/Test2/API.pm line 174 during global destruction.
                                                                                     /home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_timeout.t ............ ok
All tests successful.

Test Summary Report
-------------------
/home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_resolve_variables.t (Wstat: 0 Tests: 6 Failed: 0)
  TODO passed:   1-2
/home/xiaochen/work/ngx_http_proxy_connect_module/t/http_proxy_connect_timeout.t          (Wstat: 0 Tests: 5 Failed: 0)
  TODO passed:   1-3
Files=4, Tests=34,  3 wallclock secs ( 0.03 usr  0.02 sys +  0.35 cusr  0.68 csys =  1.08 CPU)
Result: PASS

@chobits
Copy link
Owner

chobits commented Oct 22, 2021

Have tested 1.21.1, 1.21.2, 1.21.3, all passed.

@chobits chobits merged commit 04f910b into chobits:master Oct 22, 2021
@chobits
Copy link
Owner

chobits commented Oct 22, 2021

Hi @levonet

After all the test cases, I have merged this. Thank you for ur contribution.

@levonet levonet deleted the p102101 branch November 7, 2021 17:25
@chobits chobits added this to the v0.0.3 milestone Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

兼容nginx 1.21.1吗
4 participants