Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIXED] Segfault when changing config to support dynamic module loading
This is related to PR #17 where there is a proposal to change the configuration to support dynamic module loading. This feature was introduced in NGINX 1.9.11. When compiling NGINX with config changes from PR #17 and running with NGINX 1.14.0, the server would segfault on startup with an issue in NATS plugin. The issue is due to the reference to the global variable ngx_modules which one should not do when running with dynamic modules. The proposed changes is to use ngx_count_modules() and replace references to ngx_modules with cycle->modules as described [here](https://www.nginx.com/blog/nginx-dynamic-modules-how-they-work/#ngx_count_modules) I have added a NGINX version check so that the plugin can still be statically compiled with versions earlier than 1.9.11. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
- Loading branch information
Showing
1 changed file
with
40 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters