From 3b8fe311c9a4b5da5821905fe643577fc88594df Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Wed, 4 Sep 2024 14:33:40 +0800 Subject: [PATCH 01/15] fix: remove http2 hardcode limitation in ngx.location subrequest API --- src/ngx_http_lua_subrequest.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/ngx_http_lua_subrequest.c b/src/ngx_http_lua_subrequest.c index 2ccd271a90..edb24e9c0d 100644 --- a/src/ngx_http_lua_subrequest.c +++ b/src/ngx_http_lua_subrequest.c @@ -173,12 +173,6 @@ ngx_http_lua_ngx_location_capture_multi(lua_State *L) return luaL_error(L, "no request object found"); } -#if (NGX_HTTP_V2) - if (r->main->stream) { - return luaL_error(L, "http2 requests not supported yet"); - } -#endif - ctx = ngx_http_get_module_ctx(r, ngx_http_lua_module); if (ctx == NULL) { return luaL_error(L, "no ctx found"); From 1cc8ba6722c735e60529731899988f67c41f4f8b Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Thu, 24 Oct 2024 13:41:48 +0800 Subject: [PATCH 02/15] fix: reenable ngx.location.capture test in test-nginx --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index d73f3fbdc3..2df0755b76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -87,6 +87,7 @@ install: - wget https://github.com/openresty/openresty-deps-prebuild/releases/download/v20230902/boringssl-20230902-x64-focal.tar.gz - wget https://github.com/openresty/openresty-deps-prebuild/releases/download/v20230902/curl-h3-x64-focal.tar.gz - git clone https://github.com/openresty/test-nginx.git + - git clone -b enable-ngx-location-capture-in-http2 https://github.com/oowl/test-nginx.git - git clone https://github.com/openresty/openresty.git ../openresty - git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx - git clone https://github.com/openresty/openresty-devel-utils.git From 647cf927a5770acdfca52e15823981e4ab9047f3 Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Thu, 24 Oct 2024 13:47:14 +0800 Subject: [PATCH 03/15] fix: reenable ngx.location.capture test in test-nginx --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2df0755b76..edd105d1e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -86,7 +86,6 @@ install: - if [ -n "$PCRE2_VER" ]; then wget https://github.com/openresty/openresty-deps-prebuild/releases/download/v1.0.0/pcre2-${PCRE2_VER}-x64-focal.tar.gz; fi - wget https://github.com/openresty/openresty-deps-prebuild/releases/download/v20230902/boringssl-20230902-x64-focal.tar.gz - wget https://github.com/openresty/openresty-deps-prebuild/releases/download/v20230902/curl-h3-x64-focal.tar.gz - - git clone https://github.com/openresty/test-nginx.git - git clone -b enable-ngx-location-capture-in-http2 https://github.com/oowl/test-nginx.git - git clone https://github.com/openresty/openresty.git ../openresty - git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx From 0abcb20421d0496eaff6fbd0ff80bb86023115be Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Thu, 24 Oct 2024 14:04:48 +0800 Subject: [PATCH 04/15] fix: reenable ngx.location.capture test in test-nginx --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index edd105d1e5..18330cc034 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,6 +63,8 @@ env: #- NGINX_VERSION=1.25.1 OPENSSL_VER=1.1.1w TEST_NGINX_USE_HTTP2=1 - NGINX_VERSION=1.27.1 OPENSSL_VER=1.1.1w OPENSSL_PATCH_VER=1.1.1f TEST_NGINX_TIMEOUT=5 PCRE_VER=8.45 - NGINX_VERSION=1.27.1 OPENSSL_VER=3.0.15 OPENSSL_PATCH_VER=3.0.15 TEST_NGINX_TIMEOUT=5 PCRE2_VER=10.42 + - NGINX_VERSION=1.27.1 OPENSSL_VER=1.1.1w OPENSSL_PATCH_VER=1.1.1f TEST_NGINX_TIMEOUT=5 PCRE_VER=8.45 TEST_NGINX_USE_HTTP2=1 + - NGINX_VERSION=1.27.1 OPENSSL_VER=3.0.15 OPENSSL_PATCH_VER=3.0.15 TEST_NGINX_TIMEOUT=5 PCRE2_VER=10.42 TEST_NGINX_USE_HTTP2=1 - NGINX_VERSION=1.27.1 OPENSSL_VER=3.0.15 OPENSSL_PATCH_VER=3.0.15 TEST_NGINX_USE_HTTP3=1 TEST_NGINX_QUIC_IDLE_TIMEOUT=3 PCRE2_VER=10.42 - NGINX_VERSION=1.27.1 BORINGSSL=1 TEST_NGINX_USE_HTTP3=1 TEST_NGINX_QUIC_IDLE_TIMEOUT=3 PCRE2_VER=10.42 From 877cd6a0616612e0ca4b740314b59e2c367b502a Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Thu, 24 Oct 2024 15:22:56 +0800 Subject: [PATCH 05/15] chore: reenable all http2 test --- t/005-exit.t | 2 ++ t/014-bugs.t | 2 +- t/016-resp-header.t | 1 + t/020-subrequest.t | 1 + t/023-rewrite/exit.t | 3 +++ t/024-access/exit.t | 3 +++ t/026-mysql.t | 1 + t/033-ctx.t | 2 +- t/041-header-filter.t | 38 +++++++++++++++++++------------------- t/068-socket-keepalive.t | 1 + t/091-coroutine.t | 5 +++-- t/094-uthread-exit.t | 3 +++ t/095-uthread-exec.t | 1 + t/096-uthread-redirect.t | 1 + t/138-balancer.t | 21 +-------------------- t/143-ssl-session-fetch.t | 1 - 16 files changed, 42 insertions(+), 44 deletions(-) diff --git a/t/005-exit.t b/t/005-exit.t index 0783c69295..0eff119bc7 100644 --- a/t/005-exit.t +++ b/t/005-exit.t @@ -124,6 +124,7 @@ GET /api?user=agentz === TEST 6: working with ngx_auth_request (simplest form, w/o ngx_memc) --- skip_eval: 3:$ENV{TEST_NGINX_USE_HTTP3} +--- no_http2 --- http_config eval " lua_package_cpath '$::LuaCpath'; @@ -197,6 +198,7 @@ Logged in 56 === TEST 7: working with ngx_auth_request (simplest form) --- skip_eval: 3:$ENV{TEST_NGINX_USE_HTTP3} +--- no_http2 --- http_config eval " lua_package_cpath '$::LuaCpath'; diff --git a/t/014-bugs.t b/t/014-bugs.t index d34f42e23d..303187929f 100644 --- a/t/014-bugs.t +++ b/t/014-bugs.t @@ -201,7 +201,7 @@ https://datatracker.ietf.org/doc/html/rfc7540#section-8.1.2 header field names MUST be converted to lowercase prior to their encoding in HTTP/2. A request or response containing uppercase header field names MUST be treated as malformed - +--- no_http2 --- config location /sub { content_by_lua ' diff --git a/t/016-resp-header.t b/t/016-resp-header.t index 6cf699d88e..b30090812c 100644 --- a/t/016-resp-header.t +++ b/t/016-resp-header.t @@ -298,6 +298,7 @@ Fooy: cony1, cony2 === TEST 15: set header after ngx.print +--- no_http2 --- config location /lua { default_type "text/plain"; diff --git a/t/020-subrequest.t b/t/020-subrequest.t index 37914be061..e91f3f6253 100644 --- a/t/020-subrequest.t +++ b/t/020-subrequest.t @@ -1198,6 +1198,7 @@ body: === TEST 43: subrequests with an output body filter returning NGX_ERROR +--- no_http2 --- config location /sub { echo hello world; diff --git a/t/023-rewrite/exit.t b/t/023-rewrite/exit.t index 9add80441c..7f01717eb6 100644 --- a/t/023-rewrite/exit.t +++ b/t/023-rewrite/exit.t @@ -120,6 +120,7 @@ GET /api?user=agentz === TEST 6: working with ngx_auth_request (simplest form, w/o ngx_memc) +--- no_http2 --- http_config eval " lua_package_cpath '$::LuaCpath'; @@ -192,6 +193,7 @@ Logged in 56 === TEST 7: working with ngx_auth_request (simplest form) +--- no_http2 --- http_config eval " lua_package_cpath '$::LuaCpath'; @@ -264,6 +266,7 @@ Logged in 56 === TEST 8: working with ngx_auth_request +--- no_http2 --- http_config eval " lua_package_cpath '$::LuaCpath'; diff --git a/t/024-access/exit.t b/t/024-access/exit.t index b77778213a..661ee2d8bc 100644 --- a/t/024-access/exit.t +++ b/t/024-access/exit.t @@ -114,6 +114,7 @@ GET /api?user=agentz === TEST 6: working with ngx_auth_request (simplest form, w/o ngx_memc) +--- no_http2 --- http_config eval " lua_package_cpath '$::LuaCpath'; @@ -182,6 +183,7 @@ Logged in 56 === TEST 7: working with ngx_auth_request (simplest form) +--- no_http2 --- http_config eval " lua_package_cpath '$::LuaCpath'; @@ -249,6 +251,7 @@ Logged in 56 === TEST 8: working with ngx_auth_request +--- no_http2 --- http_config eval " lua_package_cpath '$::LuaCpath'; diff --git a/t/026-mysql.t b/t/026-mysql.t index 02e14b9382..e7ab170600 100644 --- a/t/026-mysql.t +++ b/t/026-mysql.t @@ -16,6 +16,7 @@ run_tests(); __DATA__ === TEST 1: when mysql query timed out, kill that query by Lua +--- no_http2 --- http_config upstream backend { drizzle_server 127.0.0.1:$TEST_NGINX_MYSQL_PORT protocol=mysql diff --git a/t/033-ctx.t b/t/033-ctx.t index 782a0fab6e..77bd15f8c1 100644 --- a/t/033-ctx.t +++ b/t/033-ctx.t @@ -279,7 +279,7 @@ GET /t --- error_log ngx.ctx = 32 --- curl_error eval -qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ diff --git a/t/041-header-filter.t b/t/041-header-filter.t index 23fdac02cd..f5be379885 100644 --- a/t/041-header-filter.t +++ b/t/041-header-filter.t @@ -125,7 +125,7 @@ GET /read --- error_code --- response_body --- curl_error eval -qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -468,7 +468,7 @@ failed to run header_filter_by_lua*: header_filter_by_lua(nginx.conf:47):2: Some --- no_error_log [alert] --- curl_error eval -qr/curl: \(56\) Failure when receiving data from the peer|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(52\) Empty reply from server|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(56\) Failure when receiving data from the peer|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(52\) Empty reply from server|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -492,7 +492,7 @@ failed to run header_filter_by_lua*: unknown reason --- no_error_log [alert] --- curl_error eval -qr/curl: \(56\) Failure when receiving data from the peer|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(52\) Empty reply from server|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(56\) Failure when receiving data from the peer|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(52\) Empty reply from server|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -508,7 +508,7 @@ GET /lua --- error_log API disabled in the context of header_filter_by_lua* --- curl_error eval -qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -524,7 +524,7 @@ GET /lua --- error_log API disabled in the context of header_filter_by_lua* --- curl_error eval -qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -540,7 +540,7 @@ GET /lua --- error_log API disabled in the context of header_filter_by_lua* --- curl_error eval -qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -556,7 +556,7 @@ GET /lua --- error_log API disabled in the context of header_filter_by_lua* --- curl_error eval -qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -572,7 +572,7 @@ GET /lua --- error_log API disabled in the context of header_filter_by_lua* --- curl_error eval -qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -592,7 +592,7 @@ GET /lua --- error_log API disabled in the context of header_filter_by_lua* --- curl_error eval -qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -612,7 +612,7 @@ GET /lua --- error_log API disabled in the context of header_filter_by_lua* --- curl_error eval -qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -628,7 +628,7 @@ GET /lua --- error_log API disabled in the context of header_filter_by_lua* --- curl_error eval -qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -644,7 +644,7 @@ GET /lua --- error_log API disabled in the context of header_filter_by_lua* --- curl_error eval -qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -660,7 +660,7 @@ GET /lua --- error_log API disabled in the context of header_filter_by_lua* --- curl_error eval -qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -694,7 +694,7 @@ GET /lua --- error_log eval qr/API disabled in the context of header_filter_by_lua\*|http3 requests are not supported without content-length header/ms --- curl_error eval -qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -718,7 +718,7 @@ if (defined $ENV{TEST_NGINX_USE_HTTP3}) { $err_log; --- curl_error eval -qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -734,7 +734,7 @@ GET /lua --- error_log API disabled in the context of header_filter_by_lua* --- curl_error eval -qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -750,7 +750,7 @@ GET /lua --- error_log API disabled in the context of header_filter_by_lua* --- curl_error eval -qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -799,7 +799,7 @@ in function 'error' in function 'bar' in function 'foo' --- curl_error eval -qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -819,7 +819,7 @@ GET /lua?a=1&b=2 --- error_log eval qr/failed to load external Lua file ".*?test2\.lua": cannot open .*? No such file or directory/ --- curl_error eval -qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ diff --git a/t/068-socket-keepalive.t b/t/068-socket-keepalive.t index 626b441678..84481652ef 100644 --- a/t/068-socket-keepalive.t +++ b/t/068-socket-keepalive.t @@ -1384,6 +1384,7 @@ bad argument #3 to 'connect' (bad "pool" option type: boolean) === TEST 23: clear the redis store +--- no_http2 --- config location /t { redis2_query flushall; diff --git a/t/091-coroutine.t b/t/091-coroutine.t index bfbdb38937..16930ed3c0 100644 --- a/t/091-coroutine.t +++ b/t/091-coroutine.t @@ -763,7 +763,7 @@ GET /lua --- error_log API disabled in the context of header_filter_by_lua* --- curl_error eval -qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -1423,6 +1423,7 @@ GET /t === TEST 35: coroutine.wrap runtime errors do not log errors +--- no_http2 --- config location = /t { content_by_lua_block { @@ -1700,7 +1701,7 @@ GET /t "in function 'co'" ] --- curl_error eval -qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/ diff --git a/t/094-uthread-exit.t b/t/094-uthread-exit.t index 0194e44b31..5015b5e762 100644 --- a/t/094-uthread-exit.t +++ b/t/094-uthread-exit.t @@ -1313,6 +1313,7 @@ attempt to abort with pending subrequests === TEST 16: exit in entry thread (user thread is still pending on ngx.location.capture_multi), without pending output +--- no_http2 --- config location /lua { client_body_timeout 12000ms; @@ -1407,6 +1408,7 @@ qr#curl: \(52\) Empty reply from server|curl: \(95\) HTTP/3 stream 0 reset by se === TEST 17: exit(444) in user thread (entry thread is still pending on ngx.location.capture), with pending output +--- no_http2 --- config location /lua { client_body_timeout 12000ms; @@ -1492,6 +1494,7 @@ qr#curl: \(52\) Empty reply from server|curl: \(95\) HTTP/3 stream 0 reset by se === TEST 18: exit(408) in user thread (entry thread is still pending on ngx.location.capture), with pending output +--- no_http2 --- config location /lua { client_body_timeout 12000ms; diff --git a/t/095-uthread-exec.t b/t/095-uthread-exec.t index 4cd121da1e..9ef6356090 100644 --- a/t/095-uthread-exec.t +++ b/t/095-uthread-exec.t @@ -344,6 +344,7 @@ attempt to abort with pending subrequests === TEST 6: exec in entry thread (user thread is still pending on ngx.location.capture), without pending output +--- no_http2 --- config location /lua { client_body_timeout 12000ms; diff --git a/t/096-uthread-redirect.t b/t/096-uthread-redirect.t index 62909b944c..5df5ecfb09 100644 --- a/t/096-uthread-redirect.t +++ b/t/096-uthread-redirect.t @@ -190,6 +190,7 @@ free request === TEST 3: ngx.redirect() in entry thread (user thread is still pending on ngx.location.capture_multi), without pending output +--- no_http2 --- config location /lua { client_body_timeout 12000ms; diff --git a/t/138-balancer.t b/t/138-balancer.t index 41be75fcdc..30a33e63d0 100644 --- a/t/138-balancer.t +++ b/t/138-balancer.t @@ -41,9 +41,6 @@ __DATA__ '[lua] balancer_by_lua(nginx.conf:27):2: hello from balancer by lua! while connecting to upstream,', qr{\[crit\] .*? connect\(\) to 0\.0\.0\.1:80 failed .*?, upstream: "http://0\.0\.0\.1:80/t"}, ] ---- no_error_log -[warn] - === TEST 2: exit 403 @@ -95,8 +92,6 @@ qr{\[crit\] .*? connect\(\) to 0\.0\.0\.1:80 failed .*?, upstream: "http://0\.0\ '[lua] balancer_by_lua(nginx.conf:27):2: hello from balancer by lua! while connecting to upstream,', qr{\[crit\] .*? connect\(\) to 0\.0\.0\.1:80 failed .*?, upstream: "http://0\.0\.0\.1:80/t"}, ] ---- no_error_log -[warn] @@ -125,8 +120,6 @@ qr{\[crit\] .*? connect\(\) to 0\.0\.0\.1:80 failed .*?, upstream: "http://0\.0\ "2: variable foo = 33", qr/\[crit\] .* connect\(\) .*? failed/, ] ---- no_error_log -[warn] @@ -153,8 +146,6 @@ Foo: bar "header foo: bar", qr/\[crit\] .* connect\(\) .*? failed/, ] ---- no_error_log -[warn] @@ -180,12 +171,11 @@ Foo: bar ["arg foo: bar", qr/\[crit\] .* connect\(\) .*? failed/, ] ---- no_error_log -[warn] === TEST 7: ngx.req.get_method() works +--- no_http2 --- http_config upstream backend { server 0.0.0.1; @@ -208,8 +198,6 @@ Foo: bar "method: GET", qr/\[crit\] .* connect\(\) .*? failed/, ] ---- no_error_log -[warn] @@ -235,9 +223,6 @@ print("hello from balancer by lua!") '[lua] a.lua:1: hello from balancer by lua! while connecting to upstream,', qr{\[crit\] .*? connect\(\) to 0\.0\.0\.1:80 failed .*?, upstream: "http://0\.0\.0\.1:80/t"}, ] ---- no_error_log -[warn] - === TEST 9: cosockets are disabled @@ -431,8 +416,6 @@ ctx counter: nil '[lua] balancer_by_lua(nginx.conf:27):2: hello from balancer by lua! while connecting to upstream,', qr{\[crit\] .*? connect\(\) to 0\.0\.0\.1:80 failed .*?, upstream: "http://0\.0\.0\.1:80/t"}, ] ---- no_error_log -[warn] @@ -589,8 +572,6 @@ upstream sent more data than specified in "Content-Length" header while reading --- error_code: 500 --- error_log eval "failed to load inlined Lua code: balancer_by_lua(nginx.conf:27):3: ')' expected (to close '(' at line 2) near ''", ---- no_error_log -[warn] diff --git a/t/143-ssl-session-fetch.t b/t/143-ssl-session-fetch.t index b8ca095aa0..72bb3268ad 100644 --- a/t/143-ssl-session-fetch.t +++ b/t/143-ssl-session-fetch.t @@ -1319,7 +1319,6 @@ connected: 1 ssl handshake: cdata close: 1 nil --- no_error_log -[warn] [error] [alert] [emerg] From c3fed3e657e006edfbabd292d248b87c1c7a82c7 Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Thu, 24 Oct 2024 16:04:50 +0800 Subject: [PATCH 06/15] chore: reenable all http2 test --- t/005-exit.t | 4 ++-- t/041-header-filter.t | 10 +++++----- t/068-socket-keepalive.t | 1 + t/094-uthread-exit.t | 3 +-- t/138-balancer.t | 1 - t/163-signal.t | 2 +- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/t/005-exit.t b/t/005-exit.t index 0eff119bc7..fc4cc558cf 100644 --- a/t/005-exit.t +++ b/t/005-exit.t @@ -777,7 +777,7 @@ GET /t --- no_error_log [error] --- curl_error -curl: (95) HTTP/3 stream 0 reset by server +-qr/curl: \(95\) HTTP/3 stream 0 reset by server|curl: \(92\) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR \(err 2\)/ @@ -795,7 +795,7 @@ GET /t --- no_error_log [error] --- curl_error -curl: (95) HTTP/3 stream 0 reset by server +-qr/curl: \(95\) HTTP/3 stream 0 reset by server|curl: \(92\) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR \(err 2\)/ diff --git a/t/041-header-filter.t b/t/041-header-filter.t index f5be379885..fb263db0ac 100644 --- a/t/041-header-filter.t +++ b/t/041-header-filter.t @@ -468,7 +468,7 @@ failed to run header_filter_by_lua*: header_filter_by_lua(nginx.conf:47):2: Some --- no_error_log [alert] --- curl_error eval -qr/curl: \(56\) Failure when receiving data from the peer|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(52\) Empty reply from server|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(56\) Failure when receiving data from the peer|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(28\) Remote peer returned unexpected data|curl: \(52\) Empty reply from server|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -492,7 +492,7 @@ failed to run header_filter_by_lua*: unknown reason --- no_error_log [alert] --- curl_error eval -qr/curl: \(56\) Failure when receiving data from the peer|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(52\) Empty reply from server|curl: \(95\) HTTP\/3 stream 0 reset by server/ +qr/curl: \(56\) Failure when receiving data from the peer|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(28\) Remote peer returned unexpected data|curl: \(52\) Empty reply from server|curl: \(95\) HTTP\/3 stream 0 reset by server/ @@ -867,7 +867,7 @@ failed to load inlined Lua code: header_filter_by_lua(nginx.conf:41):2: unexpect --- no_error_log no_such_error --- curl_error eval -qr/curl: \(56\) Failure when receiving data from the peer/ +qr/curl: \(56\) Failure when receiving data from the peer|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly: INTERNAL_ERROR \(err 2\)/ @@ -898,7 +898,7 @@ failed to load inlined Lua code: header_filter_by_lua(nginx.conf:49):2: unexpect --- no_error_log no_such_error --- curl_error eval -qr/curl: \(56\) Failure when receiving data from the peer/ +qr/curl: \(56\) Failure when receiving data from the peer|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly: INTERNAL_ERROR \(err 2\)/ @@ -924,4 +924,4 @@ failed to load inlined Lua code: header_filter_by_lua(...90123456789012345678901 --- no_error_log [alert] --- curl_error eval -qr/curl: \(56\) Failure when receiving data from the peer/ +qr/curl: \(56\) Failure when receiving data from the peer|curl: \(56\) Failure when receiving data from the peer|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly: INTERNAL_ERROR \(err 2\)/ diff --git a/t/068-socket-keepalive.t b/t/068-socket-keepalive.t index 84481652ef..1b83ecb96f 100644 --- a/t/068-socket-keepalive.t +++ b/t/068-socket-keepalive.t @@ -3116,6 +3116,7 @@ qr{HTTP/3 stream 0 reset by server} === TEST 55: wrong second argument for setkeepalive +--- no_http2 --- quic_max_idle_timeout: 1.2 --- http_config eval "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" diff --git a/t/094-uthread-exit.t b/t/094-uthread-exit.t index 5015b5e762..ab57df0b43 100644 --- a/t/094-uthread-exit.t +++ b/t/094-uthread-exit.t @@ -1135,7 +1135,6 @@ free request attempt to abort with pending subrequests --- no_error_log [alert] -[warn] @@ -1658,6 +1657,6 @@ free request --- no_error_log [alert] [error] -[warn] + --- curl_error eval qr#curl: \(52\) Empty reply from server|curl: \(95\) HTTP/3 stream 0 reset by server# diff --git a/t/138-balancer.t b/t/138-balancer.t index 30a33e63d0..4493c70650 100644 --- a/t/138-balancer.t +++ b/t/138-balancer.t @@ -64,7 +64,6 @@ qr{\[crit\] .*? connect\(\) to 0\.0\.0\.1:80 failed .*?, upstream: "http://0\.0\ [lua] balancer_by_lua(nginx.conf:27):2: hello from balancer by lua! while connecting to upstream, --- no_error_log eval [ -'[warn]', qr{\[crit\] .*? connect\(\) to 0\.0\.0\.1:80 failed .*?, upstream: "http://0\.0\.0\.1:80/t"}, ] diff --git a/t/163-signal.t b/t/163-signal.t index 0ce8fa2613..a0c2ee8082 100644 --- a/t/163-signal.t +++ b/t/163-signal.t @@ -42,7 +42,7 @@ qr/\[notice\] \d+#\d+: exit$/ --- no_error_log eval qr/\[notice\] \d+#\d+: reconfiguring/ --- curl_error eval -qr/curl: \(28\) Operation timed out after \d+ milliseconds with 0 bytes received|curl: \(56\) Recv failure: Connection reset by peer|curl: \(55\) sendmsg\(\) returned -1 \(errno 111\)/ +qr/curl: \(28\) Operation timed out after \d+ milliseconds with 0 bytes received|curl: \(56\) Recv failure: Connection reset by peer|curl: \(56\) Failure when receiving data from the peer|curl: \(55\) sendmsg\(\) returned -1 \(errno 111\)/ From cba6c81fc3c7df5bfe471b10ee8d77dbc34241b7 Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Thu, 24 Oct 2024 16:23:30 +0800 Subject: [PATCH 07/15] chore: reenable all http2 test --- t/005-exit.t | 1 + t/041-header-filter.t | 2 ++ t/056-flush.t | 1 + t/068-socket-keepalive.t | 1 + 4 files changed, 5 insertions(+) diff --git a/t/005-exit.t b/t/005-exit.t index fc4cc558cf..e039f40791 100644 --- a/t/005-exit.t +++ b/t/005-exit.t @@ -271,6 +271,7 @@ Logged in 56 === TEST 8: working with ngx_auth_request +--- no_http2 --- skip_eval: 3:$ENV{TEST_NGINX_USE_HTTP3} --- http_config eval " diff --git a/t/041-header-filter.t b/t/041-header-filter.t index fb263db0ac..84bb39fba2 100644 --- a/t/041-header-filter.t +++ b/t/041-header-filter.t @@ -449,6 +449,7 @@ GET /lua === TEST 21: lua error (string) +--- no_http2 --- config location /lua { set $foo ''; @@ -473,6 +474,7 @@ qr/curl: \(56\) Failure when receiving data from the peer|curl: \(92\) HTTP\/2 s === TEST 22: lua error (nil) +--- no_http2 --- config location /lua { set $foo ''; diff --git a/t/056-flush.t b/t/056-flush.t index 4376b18930..ccc27073ab 100644 --- a/t/056-flush.t +++ b/t/056-flush.t @@ -491,6 +491,7 @@ GET /test === TEST 17: limit_rate +--- no_http2 --- quic_max_idle_timeout: 2 --- config location /test { diff --git a/t/068-socket-keepalive.t b/t/068-socket-keepalive.t index 1b83ecb96f..423d391799 100644 --- a/t/068-socket-keepalive.t +++ b/t/068-socket-keepalive.t @@ -3034,6 +3034,7 @@ lua tcp socket keepalive create connection pool for key "B" === TEST 54: wrong first argument for setkeepalive +--- no_http2 --- quic_max_idle_timeout: 1.2 --- http_config eval "lua_package_path '$::HtmlDir/?.lua;./?.lua;;';" From 75d37b4a8721a8a6134ee665c5c8b10dfeb064a7 Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Thu, 24 Oct 2024 17:05:04 +0800 Subject: [PATCH 08/15] chore: reenable all http2 test --- t/094-uthread-exit.t | 2 +- t/138-balancer.t | 2 +- t/143-ssl-session-fetch.t | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/t/094-uthread-exit.t b/t/094-uthread-exit.t index ab57df0b43..375d8d6023 100644 --- a/t/094-uthread-exit.t +++ b/t/094-uthread-exit.t @@ -8,7 +8,7 @@ our $StapScript = $t::StapThread::StapScript; repeat_each(2); -plan tests => repeat_each() * (blocks() * 4); +plan tests => repeat_each() * (blocks() * 4 - 2); $ENV{TEST_NGINX_RESOLVER} ||= '8.8.8.8'; $ENV{TEST_NGINX_MEMCACHED_PORT} ||= '11211'; diff --git a/t/138-balancer.t b/t/138-balancer.t index 4493c70650..5227090e3d 100644 --- a/t/138-balancer.t +++ b/t/138-balancer.t @@ -12,7 +12,7 @@ use Test::Nginx::Socket::Lua; repeat_each(2); -plan tests => repeat_each() * (blocks() * 4 + 7); +plan tests => repeat_each() * (blocks() * 4 - 3); #no_diff(); no_long_string(); diff --git a/t/143-ssl-session-fetch.t b/t/143-ssl-session-fetch.t index 72bb3268ad..8e09a52d64 100644 --- a/t/143-ssl-session-fetch.t +++ b/t/143-ssl-session-fetch.t @@ -7,7 +7,7 @@ use File::Basename; repeat_each(3); -plan tests => repeat_each() * (blocks() * 6); +plan tests => repeat_each() * (blocks() * 6) - 3; $ENV{TEST_NGINX_HTML_DIR} ||= html_dir(); From 8ab86006962b0e19a674ea78f91446fe6d297003 Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Thu, 24 Oct 2024 17:32:36 +0800 Subject: [PATCH 09/15] chore: reenable all http2 test --- t/005-exit.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/005-exit.t b/t/005-exit.t index e039f40791..300679294e 100644 --- a/t/005-exit.t +++ b/t/005-exit.t @@ -11,7 +11,7 @@ repeat_each(2); #log_level('warn'); #worker_connections(1024); -plan tests => repeat_each() * (blocks() * 3 + 2); +plan tests => repeat_each() * (blocks() * 3 + 4); $ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; $ENV{TEST_NGINX_MYSQL_PORT} ||= 3306; @@ -765,6 +765,7 @@ GET /t === TEST 27: accepts NGX_ERROR +--- no_http2 --- config location = /t { content_by_lua_block { @@ -778,11 +779,11 @@ GET /t --- no_error_log [error] --- curl_error --qr/curl: \(95\) HTTP/3 stream 0 reset by server|curl: \(92\) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR \(err 2\)/ - +curl: (95) HTTP/3 stream 0 reset by server === TEST 28: accepts NGX_DECLINED +--- no_http2 --- config location = /t { content_by_lua_block { @@ -796,8 +797,7 @@ GET /t --- no_error_log [error] --- curl_error --qr/curl: \(95\) HTTP/3 stream 0 reset by server|curl: \(92\) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR \(err 2\)/ - +curl: (95) HTTP/3 stream 0 reset by server === TEST 29: refuses NGX_AGAIN From f7477797a6e8b2e121d060ebfcb972af88efc51e Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Thu, 24 Oct 2024 17:57:07 +0800 Subject: [PATCH 10/15] chore: reenable all http2 test --- t/005-exit.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/005-exit.t b/t/005-exit.t index 300679294e..aca5d0ef6c 100644 --- a/t/005-exit.t +++ b/t/005-exit.t @@ -11,7 +11,7 @@ repeat_each(2); #log_level('warn'); #worker_connections(1024); -plan tests => repeat_each() * (blocks() * 3 + 4); +plan tests => repeat_each() * (blocks() * 3 + 2); $ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; $ENV{TEST_NGINX_MYSQL_PORT} ||= 3306; From 8cfcaa7cd0011cbfcbc981d8e64177921a7f2cf2 Mon Sep 17 00:00:00 2001 From: lijunlong Date: Tue, 5 Nov 2024 20:48:14 +0800 Subject: [PATCH 11/15] fixed tests. --- t/005-exit.t | 2 ++ t/056-flush.t | 1 - t/138-balancer.t | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/t/005-exit.t b/t/005-exit.t index aca5d0ef6c..bbaeda517e 100644 --- a/t/005-exit.t +++ b/t/005-exit.t @@ -782,6 +782,7 @@ GET /t curl: (95) HTTP/3 stream 0 reset by server + === TEST 28: accepts NGX_DECLINED --- no_http2 --- config @@ -800,6 +801,7 @@ GET /t curl: (95) HTTP/3 stream 0 reset by server + === TEST 29: refuses NGX_AGAIN --- config location = /t { diff --git a/t/056-flush.t b/t/056-flush.t index ccc27073ab..4376b18930 100644 --- a/t/056-flush.t +++ b/t/056-flush.t @@ -491,7 +491,6 @@ GET /test === TEST 17: limit_rate ---- no_http2 --- quic_max_idle_timeout: 2 --- config location /test { diff --git a/t/138-balancer.t b/t/138-balancer.t index 5227090e3d..f48c7fa41d 100644 --- a/t/138-balancer.t +++ b/t/138-balancer.t @@ -43,6 +43,7 @@ qr{\[crit\] .*? connect\(\) to 0\.0\.0\.1:80 failed .*?, upstream: "http://0\.0\ ] + === TEST 2: exit 403 --- http_config upstream backend { @@ -224,6 +225,7 @@ qr{\[crit\] .*? connect\(\) to 0\.0\.0\.1:80 failed .*?, upstream: "http://0\.0\ ] + === TEST 9: cosockets are disabled --- http_config upstream backend { From b41945f20e15cb14f15aaeaca085ebfb65ee7da0 Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Tue, 5 Nov 2024 21:18:20 +0800 Subject: [PATCH 12/15] fixed tests. --- t/056-flush.t | 1 + 1 file changed, 1 insertion(+) diff --git a/t/056-flush.t b/t/056-flush.t index 4376b18930..ccc27073ab 100644 --- a/t/056-flush.t +++ b/t/056-flush.t @@ -491,6 +491,7 @@ GET /test === TEST 17: limit_rate +--- no_http2 --- quic_max_idle_timeout: 2 --- config location /test { From 3e3902380dd47b8135e1268078f0af535b9561a0 Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Tue, 5 Nov 2024 22:02:21 +0800 Subject: [PATCH 13/15] chore: update ci --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 18330cc034..4eb8d3e5ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -88,7 +88,7 @@ install: - if [ -n "$PCRE2_VER" ]; then wget https://github.com/openresty/openresty-deps-prebuild/releases/download/v1.0.0/pcre2-${PCRE2_VER}-x64-focal.tar.gz; fi - wget https://github.com/openresty/openresty-deps-prebuild/releases/download/v20230902/boringssl-20230902-x64-focal.tar.gz - wget https://github.com/openresty/openresty-deps-prebuild/releases/download/v20230902/curl-h3-x64-focal.tar.gz - - git clone -b enable-ngx-location-capture-in-http2 https://github.com/oowl/test-nginx.git + - git clone https://github.com/openresty/test-nginx.git - git clone https://github.com/openresty/openresty.git ../openresty - git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx - git clone https://github.com/openresty/openresty-devel-utils.git From ac3721658b6eacf2905a3957d6dcb4cf788dc71d Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Tue, 5 Nov 2024 22:03:49 +0800 Subject: [PATCH 14/15] fixed tests. --- t/056-flush.t | 1 - 1 file changed, 1 deletion(-) diff --git a/t/056-flush.t b/t/056-flush.t index ccc27073ab..0c52d4040f 100644 --- a/t/056-flush.t +++ b/t/056-flush.t @@ -527,7 +527,6 @@ qr/lua flush requires waiting: buffered 0x[0-9a-f]+, delayed:1/, ]; } @errlog; - --- no_error_log [error] --- timeout: 4 From eefb0378550ac247fbe7a2ef2236e39528659c73 Mon Sep 17 00:00:00 2001 From: lijunlong Date: Tue, 5 Nov 2024 21:51:59 +0800 Subject: [PATCH 15/15] more fixes. --- t/056-flush.t | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/t/056-flush.t b/t/056-flush.t index 0c52d4040f..d2b107c754 100644 --- a/t/056-flush.t +++ b/t/056-flush.t @@ -491,7 +491,6 @@ GET /test === TEST 17: limit_rate ---- no_http2 --- quic_max_idle_timeout: 2 --- config location /test { @@ -517,7 +516,7 @@ GET /test my @errlog; if (defined $ENV{TEST_NGINX_USE_HTTP2}) { @errlog = [ -qr/lua writes elapsed 0\.[7-9]\d+ sec/, +qr/lua writes elapsed (?:0\.[7-9]\d+|[12]\.\d+) sec/, qr/lua flush requires waiting: buffered 0x[0-9a-f]+, delayed:1/, ]; } else {