Welcome! Log In Create A New Profile

Advanced

what's the proper way to get module specific configuration in init_process

June 20, 2022 04:08AM
Hello, guys,

Recently I have been working on an nginx c module, which have to
leverage on init_process routine.The logic is based on instruction
command which may be configured inside stream.server, I have to do some
work in the init_process routine, for example, to schedule a timer.
I did google a while ,and decide to using code snippet like below:

============================

ngx_stream_conf_ctx_t conf_ctx = (ngx_stream_conf_ctx_t
*)ngx_get_conf(cycle->conf_ctx, ngx_stream_module);

"module_spec_conf = conf_ctx->srv_conf["my_module".ctx_index];

=============================


However, the module_spec_conf I got is the top_level ,that is created
when nginx parse the stream section, not the one created when nginx
parse the stream.server section, the later has the proper values.
Currently to got the later structure, I have to copy the configure value
back from child to parent in configuration merger function, which is
inconvenient and buggy when the stream includes multi servers.

So I wonder what's the proper way to get module specific configuration
in the routine: init_process

Thanks

Lei
_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-leave@nginx.org
Subject Author Views Posted

what's the proper way to get module specific configuration in init_process

shanlei 455 June 20, 2022 04:08AM

Re: what's the proper way to get module specific configuration in init_process

Maxim Dounin 177 June 22, 2022 01:52PM

Re: Re: what's the proper way to get module specific configuration in init_process

shanlei 154 June 23, 2022 04:28AM

Re: Re: what's the proper way to get module specific configuration in init_process

Maxim Dounin 142 June 23, 2022 04:48PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 154
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready