diff options
author | Vladimir Homutov <vl@nginx.com> | 2016-06-15 15:10:24 +0300 |
---|---|---|
committer | Vladimir Homutov <vl@nginx.com> | 2016-06-15 15:10:24 +0300 |
commit | db5a15d2f92a592d0d312252c0294932a4bd6068 (patch) | |
tree | 377543ae38cb7747ba9af7e0de91f8897a90709a /src/stream/ngx_stream.c | |
parent | c9dae918fdf370367e2dfd92f3b19853783c9fc9 (diff) | |
download | nginx-db5a15d2f92a592d0d312252c0294932a4bd6068.tar.gz nginx-db5a15d2f92a592d0d312252c0294932a4bd6068.zip |
Stream: added preconfiguration step.
Diffstat (limited to 'src/stream/ngx_stream.c')
-rw-r--r-- | src/stream/ngx_stream.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/stream/ngx_stream.c b/src/stream/ngx_stream.c index 5e7abaebe..ea731458e 100644 --- a/src/stream/ngx_stream.c +++ b/src/stream/ngx_stream.c @@ -143,11 +143,26 @@ ngx_stream_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) } - /* parse inside the stream{} block */ - pcf = *cf; cf->ctx = ctx; + for (m = 0; cf->cycle->modules[m]; m++) { + if (cf->cycle->modules[m]->type != NGX_STREAM_MODULE) { + continue; + } + + module = cf->cycle->modules[m]->ctx; + + if (module->preconfiguration) { + if (module->preconfiguration(cf) != NGX_OK) { + return NGX_CONF_ERROR; + } + } + } + + + /* parse inside the stream{} block */ + cf->module_type = NGX_STREAM_MODULE; cf->cmd_type = NGX_STREAM_MAIN_CONF; rv = ngx_conf_parse(cf, NULL); |