aboutsummaryrefslogtreecommitdiff
path: root/src/stream/ngx_stream_realip_module.c
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2016-09-15 14:55:54 +0300
committerRoman Arutyunyan <arut@nginx.com>2016-09-15 14:55:54 +0300
commit05a455ff21aa7afd938bd45444e5d9c6d42b6c4c (patch)
treed05d36619a5d6fea63e48d039b65ca5fc3380dad /src/stream/ngx_stream_realip_module.c
parent04b9434b1817def37eb55cd7f4360d1164678797 (diff)
downloadnginx-05a455ff21aa7afd938bd45444e5d9c6d42b6c4c.tar.gz
nginx-05a455ff21aa7afd938bd45444e5d9c6d42b6c4c.zip
Stream: phases.
Diffstat (limited to 'src/stream/ngx_stream_realip_module.c')
-rw-r--r--src/stream/ngx_stream_realip_module.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/stream/ngx_stream_realip_module.c b/src/stream/ngx_stream_realip_module.c
index 8ce05a06c..0740431e3 100644
--- a/src/stream/ngx_stream_realip_module.c
+++ b/src/stream/ngx_stream_realip_module.c
@@ -279,11 +279,17 @@ ngx_stream_realip_add_variables(ngx_conf_t *cf)
static ngx_int_t
ngx_stream_realip_init(ngx_conf_t *cf)
{
+ ngx_stream_handler_pt *h;
ngx_stream_core_main_conf_t *cmcf;
cmcf = ngx_stream_conf_get_module_main_conf(cf, ngx_stream_core_module);
- cmcf->realip_handler = ngx_stream_realip_handler;
+ h = ngx_array_push(&cmcf->phases[NGX_STREAM_POST_ACCEPT_PHASE].handlers);
+ if (h == NULL) {
+ return NGX_ERROR;
+ }
+
+ *h = ngx_stream_realip_handler;
return NGX_OK;
}