Mercurial > hg > nginx
changeset 3305:8017f9bda3f6
fix "set_real_ip_from unix:" inheritance
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 11 Nov 2009 13:41:16 +0000 |
parents | 6832c7f5e189 |
children | 61bdaac6c668 |
files | src/http/modules/ngx_http_realip_module.c |
diffstat | 1 files changed, 9 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_realip_module.c Wed Nov 11 12:32:06 2009 +0000 +++ b/src/http/modules/ngx_http_realip_module.c Wed Nov 11 13:41:16 2009 +0000 @@ -26,7 +26,7 @@ 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 @@ * 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 @@ if (conf->from == NULL) { conf->from = prev->from; + } + #if (NGX_HAVE_UNIX_DOMAIN) - conf->unixsock = prev->unixsock; + 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);