Mercurial > hg > nginx
comparison src/stream/ngx_stream_realip_module.c @ 6693:3908156a51fa
Stream: phases.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Thu, 15 Sep 2016 14:55:54 +0300 |
parents | 9cac11efb205 |
children | df1a62c83b1b |
comparison
equal
deleted
inserted
replaced
6692:56fc55e32f23 | 6693:3908156a51fa |
---|---|
277 | 277 |
278 | 278 |
279 static ngx_int_t | 279 static ngx_int_t |
280 ngx_stream_realip_init(ngx_conf_t *cf) | 280 ngx_stream_realip_init(ngx_conf_t *cf) |
281 { | 281 { |
282 ngx_stream_handler_pt *h; | |
282 ngx_stream_core_main_conf_t *cmcf; | 283 ngx_stream_core_main_conf_t *cmcf; |
283 | 284 |
284 cmcf = ngx_stream_conf_get_module_main_conf(cf, ngx_stream_core_module); | 285 cmcf = ngx_stream_conf_get_module_main_conf(cf, ngx_stream_core_module); |
285 | 286 |
286 cmcf->realip_handler = ngx_stream_realip_handler; | 287 h = ngx_array_push(&cmcf->phases[NGX_STREAM_POST_ACCEPT_PHASE].handlers); |
288 if (h == NULL) { | |
289 return NGX_ERROR; | |
290 } | |
291 | |
292 *h = ngx_stream_realip_handler; | |
287 | 293 |
288 return NGX_OK; | 294 return NGX_OK; |
289 } | 295 } |
290 | 296 |
291 | 297 |