diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-11-11 13:41:16 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2009-11-11 13:41:16 +0000 |
commit | 61da56d0410513db7ea93c96756fc02bdc46efbf (patch) | |
tree | 0be0c78177e874b1d72b730b5a7c006dc8f3da50 /src/http/modules/ngx_http_realip_module.c | |
parent | 9eadbde324831b28f9138c3f3c790ba4ed98e8c7 (diff) | |
download | nginx-61da56d0410513db7ea93c96756fc02bdc46efbf.tar.gz nginx-61da56d0410513db7ea93c96756fc02bdc46efbf.zip |
fix "set_real_ip_from unix:" inheritance
Diffstat (limited to 'src/http/modules/ngx_http_realip_module.c')
-rw-r--r-- | src/http/modules/ngx_http_realip_module.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/http/modules/ngx_http_realip_module.c b/src/http/modules/ngx_http_realip_module.c index 7942042a3..b88b12242 100644 --- a/src/http/modules/ngx_http_realip_module.c +++ b/src/http/modules/ngx_http_realip_module.c @@ -26,7 +26,7 @@ typedef struct { ngx_uint_t hash; ngx_str_t header; #if (NGX_HAVE_UNIX_DOMAIN) - ngx_uint_t unixsock; /* unsigned unixsock:1; */ + ngx_uint_t unixsock; /* unsigned unixsock:2; */ #endif } ngx_http_realip_loc_conf_t; @@ -411,10 +411,12 @@ ngx_http_realip_create_loc_conf(ngx_conf_t *cf) * conf->from = NULL; * conf->hash = 0; * conf->header = { 0, NULL }; - * conf->unixsock = 0; */ conf->type = NGX_CONF_UNSET_UINT; +#if (NGX_HAVE_UNIX_DOMAIN) + conf->unixsock = 2; +#endif return conf; } @@ -428,10 +430,13 @@ ngx_http_realip_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) if (conf->from == NULL) { conf->from = prev->from; + } + #if (NGX_HAVE_UNIX_DOMAIN) - conf->unixsock = prev->unixsock; -#endif + if (conf->unixsock == 2) { + conf->unixsock = (prev->unixsock == 2) ? 0 : prev->unixsock; } +#endif ngx_conf_merge_uint_value(conf->type, prev->type, NGX_HTTP_REALIP_XREALIP); |