]> git.kaiwu.me - nginx.git/commit
SSI: handling of subrequests from other modules (ticket #1263).
authorCiel Zhao <i@ciel.dev>
Mon, 21 Nov 2022 14:01:34 +0000 (17:01 +0300)
committerCiel Zhao <i@ciel.dev>
Mon, 21 Nov 2022 14:01:34 +0000 (17:01 +0300)
commit053e40e5d45ac76ea29b803840222461f501f1e3
tree4fc9a2acf46d033943d1fabf4b911a76abbfd4b4
parent67e2a6916170f126a078bf7499a9a02c994e2f6d
SSI: handling of subrequests from other modules (ticket #1263).

As the SSI parser always uses the context from the main request for storing
variables and blocks, that context should always exist for subrequests using
SSI, even though the main request does not necessarily have SSI enabled.

However, `ngx_http_get_module_ctx(r->main, ...)` is getting NULL in such cases,
resulting in the worker crashing SIGSEGV when accessing its attributes.

This patch links the first initialized context to the main request, and
upgrades it only when main context is initialized.
src/http/modules/ngx_http_ssi_filter_module.c
src/http/modules/ngx_http_ssi_filter_module.h