Merge commit '62c49f11609644272aa3a4f1f540029759f8efab' into dev

This commit is contained in:
Théophile Diot 2024-01-12 14:14:08 +00:00
commit 74d09cb728
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06
29 changed files with 83 additions and 220 deletions

View file

@ -34,13 +34,9 @@ env:
- LUA_INCLUDE_DIR=$LUAJIT_INC
- LUA_CMODULE_DIR=/lib
- PCRE_VER=8.45
- PCRE2_VER=10.37
- PCRE_PREFIX=/opt/pcre
- PCRE2_PREFIX=/opt/pcre2
- PCRE_LIB=$PCRE_PREFIX/lib
- PCRE2_LIB=$PCRE2_PREFIX/lib
- PCRE_INC=$PCRE_PREFIX/include
- PCRE2_INC=$PCRE2_PREFIX/include
- OPENSSL_PREFIX=/opt/ssl
- OPENSSL_LIB=$OPENSSL_PREFIX/lib
- OPENSSL_INC=$OPENSSL_PREFIX/include
@ -49,8 +45,7 @@ env:
- TEST_NGINX_RANDOMIZE=1
- LUACHECK_VER=0.21.1
matrix:
- NGINX_VERSION=1.25.1 OPENSSL_VER=1.1.1w OPENSSL_PATCH_VER=1.1.1f USE_PCRE2=Y
- NGINX_VERSION=1.21.4 OPENSSL_VER=1.1.1w OPENSSL_PATCH_VER=1.1.1f
- NGINX_VERSION=1.21.4 OPENSSL_VER=1.1.1u OPENSSL_PATCH_VER=1.1.1f
services:
- memcache
@ -65,8 +60,7 @@ before_install:
install:
- if [ ! -d download-cache ]; then mkdir download-cache; fi
- if [ ! -f download-cache/openssl-$OPENSSL_VER.tar.gz ]; then wget -P download-cache https://www.openssl.org/source/openssl-$OPENSSL_VER.tar.gz || wget -P download-cache https://www.openssl.org/source/old/${OPENSSL_VER//[a-z]/}/openssl-$OPENSSL_VER.tar.gz; fi
- if [ "$USE_PCRE2" != "Y" ] && [ ! -f download-cache/pcre-$PCRE_VER.tar.gz ]; then wget -P download-cache http://ftp.cs.stanford.edu/pub/exim/pcre/pcre-$PCRE_VER.tar.gz; fi
- if [ "$USE_PCRE2" = "Y" ] && [ ! -f download-cache/pcre2-$PCRE2_VER.tar.gz ]; then wget -P download-cache https://downloads.sourceforge.net/project/pcre/pcre2/${PCRE2_VER}/pcre2-${PCRE2_VER}.tar.gz; fi
- if [ ! -f download-cache/pcre-$PCRE_VER.tar.gz ]; then wget -P download-cache http://ftp.cs.stanford.edu/pub/exim/pcre/pcre-$PCRE_VER.tar.gz; fi
- git clone https://github.com/openresty/openresty.git ../openresty
- git clone https://github.com/openresty/openresty-devel-utils.git
- git clone https://github.com/simpl/ngx_devel_kit.git ../ndk-nginx-module
@ -94,20 +88,18 @@ script:
- make -j$JOBS > build.log 2>&1 || (cat build.log && exit 1)
- sudo make PATH=$PATH install_sw > build.log 2>&1 || (cat build.log && exit 1)
- cd ../mockeagain/ && make CC=$CC -j$JOBS && cd ..
- if [ "$USE_PCRE2" != "Y" ]; then tar zxf download-cache/pcre-$PCRE_VER.tar.gz; cd pcre-$PCRE_VER/; ./configure --prefix=$PCRE_PREFIX --enable-jit --enable-utf --enable-unicode-properties > build.log 2>&1 || (cat build.log && exit 1); make -j$JOBS > build.log 2>&1 || (cat build.log && exit 1); sudo PATH=$PATH make install > build.log 2>&1 || (cat build.log && exit 1); cd ..; fi
- if [ "$USE_PCRE2" = "Y" ]; then tar zxf download-cache/pcre2-$PCRE2_VER.tar.gz; cd pcre2-$PCRE2_VER/; ./configure --prefix=$PCRE2_PREFIX --enable-jit --enable-utf > build.log 2>&1 || (cat build.log && exit 1); make -j$JOBS > build.log 2>&1 || (cat build.log && exit 1); sudo PATH=$PATH make install > build.log 2>&1 || (cat build.log && exit 1); cd ..; fi
- tar zxf download-cache/pcre-$PCRE_VER.tar.gz
- cd pcre-$PCRE_VER/
- ./configure --prefix=$PCRE_PREFIX --enable-jit --enable-utf --enable-unicode-properties > build.log 2>&1 || (cat build.log && exit 1)
- make -j$JOBS > build.log 2>&1 || (cat build.log && exit 1)
- sudo PATH=$PATH make install > build.log 2>&1 || (cat build.log && exit 1)
- cd ..
- export PATH=$PWD/work/nginx/sbin:$PWD/openresty-devel-utils:$PATH
- export LD_PRELOAD=$PWD/mockeagain/mockeagain.so
- export LD_LIBRARY_PATH=$PWD/mockeagain:$LD_LIBRARY_PATH
- export TEST_NGINX_RESOLVER=8.8.4.4
- export NGX_BUILD_CC=$CC
- export add_http3_module=--with-http_v3_module
- export disable_pcre2=--without-pcre2
- answer=`util/ver-ge "$NGINX_VERSION" 1.25.1`
- if [ "$OPENSSL_VER" = "1.1.0l" ] || [ "$answer" = "N" ]; then add_http3_module=""; fi
- if [ "$answer" = "N" ] || [ "$USE_PCRE2" = "Y" ]; then disable_pcre2=""; fi
- if [ "$USE_PCRE2" = "Y" ]; then PCRE_INC=$PCRE2_INC; PCRE_LIB=$PCRE2_LIB; fi
- ngx-build $NGINX_VERSION --with-ipv6 $disable_pcre2 $add_http3_module --with-http_realip_module --with-http_ssl_module --with-pcre-jit --with-cc-opt="-I$OPENSSL_INC -I$PCRE_INC" --with-ld-opt="-L$OPENSSL_LIB -Wl,-rpath,$OPENSSL_LIB -L$PCRE_LIB -Wl,-rpath,$PCRE_LIB" --add-module=../ndk-nginx-module --add-module=../echo-nginx-module --add-module=../set-misc-nginx-module --add-module=../headers-more-nginx-module --add-module=../lua-nginx-module --with-debug --with-stream_ssl_module --with-stream --with-ipv6 --add-module=../stream-lua-nginx-module > build.log 2>&1 || (cat build.log && exit 1)
- ngx-build $NGINX_VERSION --with-ipv6 --with-http_realip_module --with-http_ssl_module --with-pcre-jit --with-cc-opt="-I$OPENSSL_INC -I$PCRE_INC" --with-ld-opt="-L$OPENSSL_LIB -Wl,-rpath,$OPENSSL_LIB -L$PCRE_LIB -Wl,-rpath,$PCRE_LIB" --add-module=../ndk-nginx-module --add-module=../echo-nginx-module --add-module=../set-misc-nginx-module --add-module=../headers-more-nginx-module --add-module=../lua-nginx-module --with-debug --with-stream_ssl_module --with-stream --with-ipv6 --add-module=../stream-lua-nginx-module > build.log 2>&1 || (cat build.log && exit 1)
- nginx -V
- ldd `which nginx`|grep -E 'luajit|ssl|pcre'
- prove -I. -Itest-nginx/lib -j$JOBS -r t

View file

@ -55,7 +55,7 @@ This library is production ready.
Synopsis
========
This library is automatically loaded by default since OpenResty 1.15.8.1. This
This library is automatically loaded by default in OpenResty 1.15.8.1. This
behavior can be disabled via the
[lua_load_resty_core](https://github.com/openresty/lua-nginx-module#lua_load_resty_core)
directive, but note that the use of this library is vividly recommended, as its
@ -112,8 +112,8 @@ of this library in the particular OpenResty release you are using. Otherwise you
into serious compatibility issues.
* LuaJIT 2.1 (for now, it is the v2.1 git branch in the official luajit-2.0 git repository: http://luajit.org/download.html )
* [ngx_http_lua_module](https://github.com/openresty/lua-nginx-module) v0.10.25.
* [ngx_stream_lua_module](https://github.com/openresty/stream-lua-nginx-module) v0.0.13.
* [ngx_http_lua_module](https://github.com/openresty/lua-nginx-module) v0.10.21.
* [ngx_stream_lua_module](https://github.com/openresty/stream-lua-nginx-module) v0.0.11.
* [lua-resty-lrucache](https://github.com/openresty/lua-resty-lrucache)
[Back to TOC](#table-of-contents)

View file

@ -29,7 +29,7 @@ Table of Contents
Status
======
This Lua module is production ready.
This Lua module is currently considered experimental.
Synopsis
========

View file

@ -26,7 +26,9 @@ Table of Contents
Status
======
This Lua module is production ready.
This Lua module is currently considered experimental.
The API is still in flux and may change in the future without notice.
Synopsis
========

View file

@ -26,7 +26,7 @@ Table of Contents
Status
======
This Lua module is production ready.
This Lua module is currently considered experimental.
Synopsis
========

View file

@ -37,7 +37,7 @@ Table of Contents
Status
======
This Lua module is production ready.
This Lua module is currently considered experimental.
Synopsis
========

View file

@ -25,7 +25,8 @@ Table of Contents
Status
======
This Lua module is production ready.
This Lua module is currently considered experimental.
The API is still in flux and may change in the future without notice.
Synopsis
========

View file

@ -24,7 +24,7 @@ Table of Contents
Status
======
This Lua module is production ready.
This Lua module is currently considered experimental.
Synopsis
========

View file

@ -22,7 +22,7 @@ Table of Contents
Status
======
This Lua module is production ready.
This Lua module is currently considered experimental.
Synopsis
========

View file

@ -22,7 +22,7 @@ Table of Contents
Status
======
This Lua module is production ready.
This Lua module is currently considered experimental.
Synopsis
========

View file

@ -193,12 +193,12 @@ end
local prot_map = {
["SSLv2"] = 0x0002,
["SSLv3"] = 0x0004,
["TLSv1"] = 0x0008,
["TLSv1.1"] = 0x0010,
["TLSv1.2"] = 0x0020,
["TLSv1.3"] = 0x0040
["SSLv2"] = 0x0002,
["SSLv3"] = 0x0004,
["TLSv1"] = 0x0008,
["TLSv1.1"] = 0x0010,
["TLSv1.2"] = 0x0020,
["TLSv1.3"] = 0x0040
}

View file

@ -25,7 +25,7 @@ Table of Contents
Status
======
This Lua module is production ready.
This Lua module is currently considered experimental.
Synopsis
========

View file

@ -19,22 +19,22 @@ local FREE_LIST_REF = 0
if subsystem == 'http' then
if not ngx.config
or not ngx.config.ngx_lua_version
or ngx.config.ngx_lua_version ~= 10026
or ngx.config.ngx_lua_version ~= 10025
then
error("ngx_http_lua_module 0.10.26 required")
error("ngx_http_lua_module 0.10.25 required")
end
elseif subsystem == 'stream' then
if not ngx.config
or not ngx.config.ngx_lua_version
or ngx.config.ngx_lua_version ~= 14
or ngx.config.ngx_lua_version ~= 13
then
error("ngx_stream_lua_module 0.0.14 required")
error("ngx_stream_lua_module 0.0.13 required")
end
else
error("ngx_http_lua_module 0.10.26 or "
.. "ngx_stream_lua_module 0.0.14 required")
error("ngx_http_lua_module 0.10.25 or "
.. "ngx_stream_lua_module 0.0.13 required")
end
@ -141,7 +141,7 @@ local c_buf_type = ffi.typeof("char[?]")
local _M = new_tab(0, 18)
_M.version = "0.1.28"
_M.version = "0.1.27"
_M.new_tab = new_tab
_M.clear_tab = clear_tab

View file

@ -82,7 +82,7 @@ if not pcall(function() pcre_ver = ffi_string(pcre_ver_fn()) end) then
end
local MAX_ERR_MSG_LEN = 256
local MAX_ERR_MSG_LEN = 128
local FLAG_COMPILE_ONCE = 0x01
@ -102,7 +102,6 @@ local PCRE_DUPNAMES = 0x0080000
local PCRE_JAVASCRIPT_COMPAT = 0x2000000
-- PCRE2_ERROR_NOMATCH uses the same value
local PCRE_ERROR_NOMATCH = -1
@ -136,44 +135,22 @@ local ngx_lua_ffi_script_eval_data
-- TODO: improve this workaround when PCRE allows for unspecifying the MAP_JIT
-- option.
local no_jit_in_init
local pcre_ver_num
local maj, min = string.match(pcre_ver, "^(%d+)%.(%d+)")
if maj and min then
pcre_ver_num = tonumber(maj .. min)
end
if jit.os == "OSX" then
if pcre_ver_num == nil then
-- assume this version is faulty as well
no_jit_in_init = true
local maj, min = string.match(pcre_ver, "^(%d+)%.(%d+)")
if maj and min then
local pcre_ver_num = tonumber(maj .. min)
-- PCRE2 is also subject to this issue on macOS
elseif pcre_ver_num >= 843 then
if pcre_ver_num >= 843 then
no_jit_in_init = true
end
else
-- assume this version is faulty as well
no_jit_in_init = true
end
end
-- pcre2
if pcre_ver_num > 845 then
-- option
PCRE_CASELESS = 0x00000008
PCRE_MULTILINE = 0x00000400
PCRE_DOTALL = 0x00000020
PCRE_EXTENDED = 0x00000080
PCRE_ANCHORED = 0x80000000
PCRE_UTF8 = 0x00080000
PCRE_DUPNAMES = 0x00000040
-- In the pcre2, The PCRE_JAVASCRIPT_COMPAT option has been split into
-- independent functional options PCRE2_ALT_BSUX, PCRE2_ALLOW_EMPTY_CLASS,
-- and PCRE2_MATCH_UNSET_BACKREF.
local PCRE2_ALT_BSUX = 0x00000002
local PCRE2_ALLOW_EMPTY_CLASS = 0x00000001
local PCRE2_MATCH_UNSET_BACKREF = 0x00000200
PCRE_JAVASCRIPT_COMPAT = bor(PCRE2_ALT_BSUX, PCRE2_ALLOW_EMPTY_CLASS)
PCRE_JAVASCRIPT_COMPAT = bor(PCRE2_MATCH_UNSET_BACKREF,
PCRE_JAVASCRIPT_COMPAT)
end
if subsystem == 'http' then
ffi.cdef[[

View file

@ -57,7 +57,7 @@ monotonic_msec
**syntax:** *monotonic_msec()*
Returns the elapsed time in milliseconds from the machine boot for the current time stamp from the Nginx cached time (no syscall involved unlike Lua's date library).
Returns the elapsed time in microseconds from the machine boot for the current time stamp from the Nginx cached time (no syscall involved unlike Lua's date library).
```lua
local cur_msec = require "resty.core.time".monotonic_msec

View file

@ -74,8 +74,6 @@ end
if is_not_windows then
if subsystem == "http" then
require "resty.core.phase" -- for ngx.get_phase
ffi.cdef[[
int ngx_http_lua_ffi_worker_pids(int *pids, size_t *pids_len);
]]
@ -90,18 +88,16 @@ if is_not_windows then
ngx_lua_ffi_worker_pids = C.ngx_stream_lua_ffi_worker_pids
end
local ngx_phase = ngx.get_phase
function ngx.worker.pids()
local phase = ngx_phase()
if phase == "init" or phase == "init_worker" then
if ngx.get_phase() == "init" or ngx.get_phase() == "init_worker" then
return nil, "API disabled in the current context"
end
local pids = {}
local size_ptr = get_size_ptr()
-- the old and the new workers coexist during reloading
local worker_cnt = ngx_lua_ffi_worker_count() * 4
local worker_cnt = ngx.worker.count() * 4
if worker_cnt == 0 then
return pids
end
@ -121,7 +117,6 @@ if is_not_windows then
end
end
function ngx.worker.id()
local id = ngx_lua_ffi_worker_id()
if id < 0 then

View file

@ -379,7 +379,6 @@ lua release ngx.ctx at ref 1
}
--- config
lua_ssl_trusted_certificate ../../cert/test.crt;
lua_ssl_protocols TLSv1.2;
location /t {
content_by_lua_block {
@ -482,7 +481,6 @@ lua release ngx.ctx at ref 1
}
--- config
lua_ssl_trusted_certificate ../../cert/test.crt;
lua_ssl_protocols TLSv1.2;
location /t {
content_by_lua_block {
@ -537,7 +535,6 @@ lua release ngx.ctx at ref 1
ssl_session_tickets off;
ssl_certificate ../../cert/test.crt;
ssl_certificate_key ../../cert/test.key;
ssl_protocols TLSv1.2;
server_tokens off;
location /foo {
@ -639,7 +636,6 @@ lua release ngx.ctx at ref 1
ssl_session_tickets off;
ssl_certificate ../../cert/test.crt;
ssl_certificate_key ../../cert/test.key;
ssl_protocols TLSv1.2;
server_tokens off;
location /foo {
@ -706,7 +702,6 @@ lua release ngx.ctx at ref 1
ssl_session_tickets off;
ssl_certificate ../../cert/test.crt;
ssl_certificate_key ../../cert/test.key;
ssl_protocols TLSv1.2;
ssl_certificate_by_lua_block {
ngx.ctx.count = ngx.ctx.count and (ngx.ctx.count + 100) or 100

View file

@ -1025,7 +1025,6 @@ MD5\([^)]+\)= 8bc944dbd052ef51652e70a5104492e3
}
--- response_body
closed
--- timeout: 10s

View file

@ -26,11 +26,8 @@ __DATA__
}
--- request
GET /re
--- response_body eval
$Test::Nginx::Util::PcreVersion == 2 ?
"error: pcre2_compile() failed: missing closing parenthesis in \"(abc\"\n"
:
"error: pcre_compile() failed: missing ) in \"(abc\"\n"
--- response_body
error: pcre_compile() failed: missing ) in "(abc"
--- no_error_log
[error]
@ -66,11 +63,8 @@ $Test::Nginx::Util::PcreVersion == 2 ?
}
--- request
GET /t
--- response_body eval
$Test::Nginx::Util::PcreVersion == 2 ?
"error: pcre_exec\(\) failed: -4\n"
:
"error: pcre_exec\(\) failed: -10\n"
--- response_body_like chop
error: pcre_exec\(\) failed: -10
--- no_error_log
[error]
@ -134,7 +128,6 @@ probe process("$LIBPCRE_PATH").function("pcre_exec") {
printf("exec opts: %x\n", $options)
}
# TODO: PCRE2 use different option values from PCRE
--- stap_out
compile opts: 800
exec opts: 0
@ -179,14 +172,8 @@ end
--- request
GET /re
--- response_body eval
# lua_regex_match_limit uses pcre_extra->match_limit in the PCRE,
# but PCRE2 replaces this with pcre2_set_match_limit interface,
# which has different effects.
$Test::Nginx::Util::PcreVersion == 2 ?
"failed to match\n"
:
"error: pcre_exec() failed: -8\n"
--- response_body
error: pcre_exec() failed: -8

View file

@ -446,13 +446,9 @@ matched: nil
}
--- request
GET /re
--- response_body eval
# PCRE2_ERROR_UTF8_ERR2 (-4)
# PCRE_ERROR_BADUTF8 (-10)
$Test::Nginx::Util::PcreVersion == 2 ?
"error: pcre_exec\(\) failed: -4\nnot matched\n"
:
"error: pcre_exec\(\) failed: -10\nnot matched\n"
--- response_body
error: pcre_exec() failed: -10
not matched
--- no_error_log
[error]

View file

@ -306,11 +306,8 @@ NYI
}
--- request
GET /re
--- response_body eval
$Test::Nginx::Util::PcreVersion == 2 ?
"error: pcre2_compile\(\) failed: two named subpatterns have the same name \(PCRE2_DUPNAMES not set\) in \"\(\?<first>[a-z])\(\?<first>[a-z]+\), [0-9]+\" at \"[a-z]+\), [0-9]+\"\n"
:
"error: pcre_compile\(\) failed: two named subpatterns have the same name in \"\(\?<first>[a-z])\(\?<first>[a-z]+\), [0-9]+\" at \">[a-z]+\), [0-9]+\"\n"
--- response_body_like chop
error: pcre_compile\(\) failed: two named subpatterns have the same name
--- error_log eval
qr/\[TRACE\s+\d+/

View file

@ -39,13 +39,8 @@ __DATA__
}
--- request
GET /re
--- response_body eval
# PCRE2_ERROR_JIT_STACKLIMIT (-46)
# PCRE_ERROR_JIT_STACKLIMIT (-27)
$Test::Nginx::Util::PcreVersion == 2 ?
"error: pcre_exec\(\) failed: -46\n"
:
"error: pcre_exec\(\) failed: -27\n"
--- response_body
error: pcre_exec() failed: -27
--- no_error_log
[error]
--- timeout: 10

View file

@ -51,7 +51,6 @@ __DATA__
resolver $TEST_NGINX_RESOLVER;
lua_ssl_trusted_certificate $TEST_NGINX_CERT_DIR/cert/test.crt;
lua_ssl_verify_depth 3;
lua_ssl_protocols TLSv1.2;
location /t {
set $port $TEST_NGINX_MEMCACHED_PORT;
@ -98,7 +97,7 @@ qr/ssl_session_fetch_by_lua\(nginx.conf:\d+\):\d+: session id: [a-fA-f\d]+/s
--- grep_error_log_out eval
[
"",
qr/ssl_session_fetch_by_lua\(nginx.conf:\d+\):4: session id: [a-fA-f\d]+/s,
qr/ssl_session_fetch_by_lua\(nginx.conf:\d+\):4: session id: [a-fA-f\d]+/s,
qr/ssl_session_fetch_by_lua\(nginx.conf:\d+\):4: session id: [a-fA-f\d]+/s,
]
@ -139,7 +138,6 @@ qr/ssl_session_fetch_by_lua\(nginx.conf:\d+\):4: session id: [a-fA-f\d]+/s,
resolver $TEST_NGINX_RESOLVER;
lua_ssl_trusted_certificate $TEST_NGINX_CERT_DIR/cert/test.crt;
lua_ssl_verify_depth 3;
lua_ssl_protocols TLSv1.2;
location /t {
set $port $TEST_NGINX_MEMCACHED_PORT;
@ -186,7 +184,8 @@ qr/ssl_session_fetch_by_lua:\d: session size: [a-fA-f\d]+|get session error: bad
--- grep_error_log_out eval
[
"",
'get session error: bad session in lua context
',
'get session error: bad session in lua context
',
'get session error: bad session in lua context
@ -247,7 +246,6 @@ In practice, never store session in plaintext on persistent storage.
resolver $TEST_NGINX_RESOLVER;
lua_ssl_trusted_certificate $TEST_NGINX_CERT_DIR/cert/test.crt;
lua_ssl_verify_depth 3;
lua_ssl_protocols TLSv1.2;
location /t {
set $port $TEST_NGINX_MEMCACHED_PORT;
@ -344,7 +342,6 @@ able to carry on and negotiate a new session.
resolver $TEST_NGINX_RESOLVER;
lua_ssl_trusted_certificate $TEST_NGINX_CERT_DIR/cert/test.crt;
lua_ssl_verify_depth 3;
lua_ssl_protocols TLSv1.2;
location /t {
set $port $TEST_NGINX_MEMCACHED_PORT;
@ -391,7 +388,10 @@ qr/failed to resume session: failed to de-serialize session|ssl_session_(fetch|s
--- grep_error_log_out eval
[
qr/^ssl_session_store_by_lua\(nginx.conf:\d+\):5: session id: [a-fA-F\d]+$/s,
qr/^ssl_session_fetch_by_lua\(nginx.conf:\d+\):4: session id: [a-fA-F\d]+
failed to resume session: failed to de-serialize session
ssl_session_store_by_lua\(nginx.conf:\d+\):5: session id: [a-fA-F\d]+
$/s,
qr/^ssl_session_fetch_by_lua\(nginx.conf:\d+\):4: session id: [a-fA-F\d]+
failed to resume session: failed to de-serialize session
ssl_session_store_by_lua\(nginx.conf:\d+\):5: session id: [a-fA-F\d]+
@ -440,7 +440,6 @@ $/s,
ssl_session_tickets off;
ssl_certificate $TEST_NGINX_CERT_DIR/cert/test.crt;
ssl_certificate_key $TEST_NGINX_CERT_DIR/cert/test.key;
ssl_protocols TLSv1.2;
location / {
content_by_lua_block {
@ -558,7 +557,6 @@ $/s,
--- config
lua_ssl_trusted_certificate $TEST_NGINX_CERT_DIR/cert/test.crt;
lua_ssl_verify_depth 3;
lua_ssl_protocols TLSv1.2;
location /t {
set $port $TEST_NGINX_MEMCACHED_PORT;

View file

@ -49,7 +49,6 @@ __DATA__
resolver $TEST_NGINX_RESOLVER;
lua_ssl_trusted_certificate $TEST_NGINX_CERT_DIR/cert/test.crt;
lua_ssl_verify_depth 3;
lua_ssl_protocols TLSv1.2;
location /t {
set $port $TEST_NGINX_MEMCACHED_PORT;
@ -122,7 +121,6 @@ qr/ssl_session_store_by_lua\(nginx.conf:\d+\):4: session size: \d+/s
resolver $TEST_NGINX_RESOLVER;
lua_ssl_trusted_certificate $TEST_NGINX_CERT_DIR/cert/test.crt;
lua_ssl_verify_depth 3;
lua_ssl_protocols TLSv1.2;
location /t {
set $port $TEST_NGINX_MEMCACHED_PORT;
@ -231,7 +229,6 @@ qr/ssl_session_store_by_lua\(nginx.conf:\d+\):4: session id: [a-fA-f\d]+/s
resolver $TEST_NGINX_RESOLVER;
lua_ssl_trusted_certificate $TEST_NGINX_CERT_DIR/cert/test.crt;
lua_ssl_verify_depth 3;
lua_ssl_protocols TLSv1.2;
location /t {
set $port $TEST_NGINX_MEMCACHED_PORT;

View file

@ -22,11 +22,8 @@ __DATA__
ngx.say("error: ", err)
end
}
--- stream_response eval
$Test::Nginx::Util::PcreVersion == 2 ?
"error: pcre2_compile() failed: missing closing parenthesis in \"(abc\"\n"
:
"error: pcre_compile() failed: missing ) in \"(abc\"\n"
--- stream_response
error: pcre_compile() failed: missing ) in "(abc"
--- no_error_log
[error]
@ -58,17 +55,12 @@ $Test::Nginx::Util::PcreVersion == 2 ?
ngx.say("not matched")
end
}
--- stream_response eval
$Test::Nginx::Util::PcreVersion == 2 ?
"error: pcre_exec\(\) failed: -4\n"
:
"error: pcre_exec\(\) failed: -10\n"
--- stream_response_like chop
error: pcre_exec\(\) failed: -10
--- no_error_log
[error]
--- ONLY
=== TEST 3: UTF-8 mode without UTF-8 sequence checks
@ -122,7 +114,6 @@ probe process("$LIBPCRE_PATH").function("pcre_exec") {
printf("exec opts: %x\n", $options)
}
# TODO: PCRE2 use different option values from PCRE
--- stap_out
compile opts: 800
exec opts: 0
@ -161,14 +152,8 @@ if not res then
return
end
--- stream_response eval
# lua_regex_match_limit uses pcre_extra->match_limit in the PCRE,
# but PCRE2 replaces this with pcre2_set_match_limit interface,
# which has different effects.
$Test::Nginx::Util::PcreVersion == 2 ?
"failed to match\n"
:
"error: pcre_exec() failed: -8\n"
--- stream_response
error: pcre_exec() failed: -8

View file

@ -394,13 +394,9 @@ matched: nil
ngx.say("not matched")
end
}
--- stream_response eval
# PCRE2_ERROR_UTF8_ERR2 (-4)
# PCRE_ERROR_BADUTF8 (-10)
$Test::Nginx::Util::PcreVersion == 2 ?
"error: pcre_exec\(\) failed: -4\nnot matched\n"
:
"error: pcre_exec\(\) failed: -10\nnot matched\n"
--- stream_response
error: pcre_exec() failed: -10
not matched
--- no_error_log
[error]

View file

@ -268,11 +268,8 @@ NYI
ngx.say("not matched!")
end
}
--- stream_response eval
$Test::Nginx::Util::PcreVersion == 2 ?
"error: pcre2_compile\(\) failed: two named subpatterns have the same name \(PCRE2_DUPNAMES not set\) in \"\(\?<first>[a-z])\(\?<first>[a-z]+\), [0-9]+\" at \"[a-z]+\), [0-9]+\"\n"
:
"error: pcre_compile\(\) failed: two named subpatterns have the same name in \"\(\?<first>[a-z])\(\?<first>[a-z]+\), [0-9]+\" at \">[a-z]+\), [0-9]+\"\n"
--- stream_response_like chop
error: pcre_compile\(\) failed: two named subpatterns have the same name
--- error_log eval
qr/\[TRACE\s+\d+/

View file

@ -36,13 +36,8 @@ __DATA__
ngx.say("not matched!")
end
}
--- stream_response eval
# PCRE2_ERROR_JIT_STACKLIMIT (-46)
# PCRE_ERROR_JIT_STACKLIMIT (-27)
$Test::Nginx::Util::PcreVersion == 2 ?
"error: pcre_exec\(\) failed: -46\n"
:
"error: pcre_exec\(\) failed: -27\n"
--- stream_response
error: pcre_exec() failed: -27
--- no_error_log
[error]
--- timeout: 10

View file

@ -1,41 +0,0 @@
#!/usr/bin/env perl
use strict;
use warnings;
sub usage {
die "Usage: $0 <ver1> <ver2>\n";
}
my $a = shift or usage();
my $b = shift or usage();
my @as = split /\./, $a;
my @bs = split /\./, $b;
my $n = @as > @bs ? scalar(@as) : scalar(@bs);
for (my $i = 0; $i < $n; $i++) {
my $x = $as[$i];
my $y = $bs[$i];
if (!defined $x) {
$x = 0;
}
if (!defined $y) {
$y = 0;
}
if ($x > $y) {
print "Y\n";
exit;
} elsif ($x < $y) {
print "N\n";
exit;
}
}
print "Y\n";