diff src/http/modules/ngx_http_realip_module.c @ 544:40c366b3535c NGINX_0_8_24

nginx 0.8.24 *) Bugfix: nginx always added "Content-Encoding: gzip" response header line in 304 responses sent by ngx_http_gzip_static_module. *) Bugfix: nginx could not be built without the --with-debug option; the bug had appeared in 0.8.23. *) Bugfix: the "unix:" parameter of the "set_real_ip_from" directive inherited incorrectly from previous level. *) Bugfix: in resolving empty name.
author Igor Sysoev <http://sysoev.ru>
date Wed, 11 Nov 2009 00:00:00 +0300
parents 2b9e388c61f1
children d0f7a625f27c
line wrap: on
line diff
--- 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
      *     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_
 
     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);