Tags: openresty/stream-lua-nginx-module
Tags
bugfix: avoid use-after-free after receiveuntil iterator GC. Detach the compiled pattern from the upstream when finalizing the read side, and clear the upstream reference to the pattern. This prevents socket finalization from accessing a pattern already freed by Lua GC. Port the fix and regression test from lua-nginx-module commit 20acb75174d3f6ce3578cb96070218fd4466ce43. The test verifies that the iterator is collected after a read error before closing the socket. Validated with t/066-socket-receiveuntil.t and t/084-inclusive-receiveuntil.t: all 188 assertions passed.
bugfix: clean child coroutine ops when killing uthreads. Cancel descendant coroutine operations before deleting killed user threads so delayed cosocket events cannot resume collected Lua states.
bugfix: ngx.req.start_time() corrupted nginx's cached time on freenginx. ngx_stream_lua_ffi_req_start_time() (the freenginx branch) called ngx_timeofday() and then mutated *tp directly. ngx_timeofday() returns a pointer to ngx_cached_time, the global time cache shared by the entire worker, so the subtraction of (ngx_current_msec - r->session->start_time) silently rewound the clock for every subsequent ngx_timeofday() reader within the same event-loop tick (log timestamps, timer deadlines, etc.). Copy the cached time into a local ngx_time_t and do the arithmetic there. Mirrors the fix in lua-nginx-module.
bugfix: use NGX_SOCKADDR_STRLEN for portability on Windows & FreeBSD NGX_UNIX_ADDRSTRLEN is only defined when Unix domain sockets are supported, which excludes Windows. Use NGX_SOCKADDR_STRLEN instead for the address text buffer in cosocket error logging, which is defined on all platforms.
bugfix: supress clang warning.
../ngx_stream_lua-0.0.18RC1/src/ngx_stream_lua_proxy_ssl_certby.c:66:25: warning: variable 'ssl' may be uninitialized when used here [-Wconditional-uninitialized]
66 | SSL_CTX_set_cert_cb(ssl->ctx, ngx_stream_lua_proxy_ssl_cert_handler, NULL);
| ^~~
../ngx_stream_lua-0.0.18RC1/src/ngx_stream_lua_proxy_ssl_certby.c:33:29: note: initialize the variable 'ssl' to silence this warning
33 | ngx_ssl_t *ssl;
| ^
| = NULL
PreviousNext