[nginx] svn commit: r4698 - in trunk: auto src/http

ru at nginx.com ru at nginx.com
Thu Jun 21 11:02:22 UTC 2012


Author: ru
Date: 2012-06-21 11:02:22 +0000 (Thu, 21 Jun 2012)
New Revision: 4698
URL: http://trac.nginx.org/nginx/changeset/4698/nginx

Log:
Fixed compile-time conditionals used to detect if X-Forwarded-For support
is needed.


Modified:
   trunk/auto/modules
   trunk/src/http/ngx_http_request.c
   trunk/src/http/ngx_http_request.h
   trunk/src/http/ngx_http_variables.c

Modified: trunk/auto/modules
===================================================================
--- trunk/auto/modules	2012-06-20 12:55:28 UTC (rev 4697)
+++ trunk/auto/modules	2012-06-21 11:02:22 UTC (rev 4698)
@@ -223,6 +223,7 @@
 
 if [ $HTTP_REALIP = YES ]; then
     have=NGX_HTTP_REALIP . auto/have
+    have=NGX_HTTP_X_FORWARDED_FOR . auto/have
     HTTP_MODULES="$HTTP_MODULES $HTTP_REALIP_MODULE"
     HTTP_SRCS="$HTTP_SRCS $HTTP_REALIP_SRCS"
 fi
@@ -233,12 +234,13 @@
 fi
 
 if [ $HTTP_GEO = YES ]; then
-    have=NGX_HTTP_GEO . auto/have
+    have=NGX_HTTP_X_FORWARDED_FOR . auto/have
     HTTP_MODULES="$HTTP_MODULES $HTTP_GEO_MODULE"
     HTTP_SRCS="$HTTP_SRCS $HTTP_GEO_SRCS"
 fi
 
 if [ $HTTP_GEOIP = YES ]; then
+    have=NGX_HTTP_X_FORWARDED_FOR . auto/have
     HTTP_MODULES="$HTTP_MODULES $HTTP_GEOIP_MODULE"
     HTTP_SRCS="$HTTP_SRCS $HTTP_GEOIP_SRCS"
 fi
@@ -273,7 +275,7 @@
 fi
 
 if [ $HTTP_PROXY = YES ]; then
-    have=NGX_HTTP_PROXY . auto/have
+    have=NGX_HTTP_X_FORWARDED_FOR . auto/have
     #USE_MD5=YES
     HTTP_MODULES="$HTTP_MODULES $HTTP_PROXY_MODULE"
     HTTP_DEPS="$HTTP_DEPS $HTTP_PROXY_DEPS"

Modified: trunk/src/http/ngx_http_request.c
===================================================================
--- trunk/src/http/ngx_http_request.c	2012-06-20 12:55:28 UTC (rev 4697)
+++ trunk/src/http/ngx_http_request.c	2012-06-21 11:02:22 UTC (rev 4698)
@@ -138,7 +138,7 @@
     { ngx_string("Keep-Alive"), offsetof(ngx_http_headers_in_t, keep_alive),
                  ngx_http_process_header_line },
 
-#if (NGX_HTTP_PROXY || NGX_HTTP_REALIP || NGX_HTTP_GEO)
+#if (NGX_HTTP_X_FORWARDED_FOR)
     { ngx_string("X-Forwarded-For"),
                  offsetof(ngx_http_headers_in_t, x_forwarded_for),
                  ngx_http_process_header_line },

Modified: trunk/src/http/ngx_http_request.h
===================================================================
--- trunk/src/http/ngx_http_request.h	2012-06-20 12:55:28 UTC (rev 4697)
+++ trunk/src/http/ngx_http_request.h	2012-06-21 11:02:22 UTC (rev 4698)
@@ -192,7 +192,7 @@
 
     ngx_table_elt_t                  *keep_alive;
 
-#if (NGX_HTTP_PROXY || NGX_HTTP_REALIP || NGX_HTTP_GEO)
+#if (NGX_HTTP_X_FORWARDED_FOR)
     ngx_table_elt_t                  *x_forwarded_for;
 #endif
 

Modified: trunk/src/http/ngx_http_variables.c
===================================================================
--- trunk/src/http/ngx_http_variables.c	2012-06-20 12:55:28 UTC (rev 4697)
+++ trunk/src/http/ngx_http_variables.c	2012-06-21 11:02:22 UTC (rev 4698)
@@ -134,7 +134,7 @@
       offsetof(ngx_http_request_t, headers_in.via), 0, 0 },
 #endif
 
-#if (NGX_HTTP_PROXY || NGX_HTTP_REALIP)
+#if (NGX_HTTP_X_FORWARDED_FOR)
     { ngx_string("http_x_forwarded_for"), NULL, ngx_http_variable_header,
       offsetof(ngx_http_request_t, headers_in.x_forwarded_for), 0, 0 },
 #endif



More information about the nginx-devel mailing list