diff src/http/ngx_http_request.h @ 4732:613390a974df stable-1.2

Merge of r4698: X-Forwarded-For conditionals. Fixed compile-time conditionals used to detect if X-Forwarded-For support is needed. Note: compatibility shims were added during merge to avoid possible breakage of 3rd party modules. At least cache purge module was broken by the original commit, as it used to rely on NGX_HTTP_PROXY define.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 02 Jul 2012 17:41:52 +0000
parents cb1d3b48a848
children
line wrap: on
line diff
--- a/src/http/ngx_http_request.h
+++ b/src/http/ngx_http_request.h
@@ -137,6 +137,13 @@
 #define NGX_HTTP_COPY_BUFFERED             0x04
 
 
+#if (NGX_HTTP_PROXY || NGX_HTTP_REALIP || NGX_HTTP_GEO)
+#ifndef NGX_HTTP_X_FORWARDED_FOR
+#define NGX_HTTP_X_FORWARDED_FOR           1
+#endif
+#endif
+
+
 typedef enum {
     NGX_HTTP_INITING_REQUEST_STATE = 0,
     NGX_HTTP_READING_REQUEST_STATE,
@@ -192,7 +199,7 @@ typedef struct {
 
     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