]> git.kaiwu.me - nginx.git/commitdiff
Variables: macros for null variables.
authorRuslan Ermilov <ru@nginx.com>
Tue, 1 Aug 2017 11:28:33 +0000 (14:28 +0300)
committerRuslan Ermilov <ru@nginx.com>
Tue, 1 Aug 2017 11:28:33 +0000 (14:28 +0300)
No functional changes.

19 files changed:
src/http/modules/ngx_http_browser_module.c
src/http/modules/ngx_http_fastcgi_module.c
src/http/modules/ngx_http_geoip_module.c
src/http/modules/ngx_http_proxy_module.c
src/http/modules/ngx_http_realip_module.c
src/http/modules/ngx_http_ssi_filter_module.c
src/http/modules/ngx_http_ssl_module.c
src/http/modules/ngx_http_stub_status_module.c
src/http/ngx_http_upstream.c
src/http/ngx_http_variables.c
src/http/ngx_http_variables.h
src/http/v2/ngx_http_v2_module.c
src/stream/ngx_stream_geoip_module.c
src/stream/ngx_stream_realip_module.c
src/stream/ngx_stream_ssl_module.c
src/stream/ngx_stream_ssl_preread_module.c
src/stream/ngx_stream_upstream.c
src/stream/ngx_stream_variables.c
src/stream/ngx_stream_variables.h

index 95cab49aa35aca42d3c78d189e3d727d3285145a..f774254842839bddbf6b0d675f2485046fc875ef 100644 (file)
@@ -222,7 +222,7 @@ static ngx_http_variable_t  ngx_http_browser_vars[] = {
     { ngx_string("ancient_browser"), NULL, ngx_http_browser_variable,
       NGX_HTTP_ANCIENT_BROWSER, NGX_HTTP_VAR_CHANGEABLE, 0 },
 
-    { ngx_null_string, NULL, NULL, 0, 0, 0 }
+      ngx_http_null_variable
 };
 
 
index 741e5776850f83e5ce37c621b2aaf1b0bf218049..ea16ecae9eb88e9af8f7ad7c3e093d13b552a08b 100644 (file)
@@ -631,7 +631,7 @@ static ngx_http_variable_t  ngx_http_fastcgi_vars[] = {
       ngx_http_fastcgi_path_info_variable, 0,
       NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
 
-    { ngx_null_string, NULL, NULL, 0, 0, 0 }
+      ngx_http_null_variable
 };
 
 
index 8e151aa8f20cc67741c36b36ecc18787867aaf38..5ea4f5fb05fb2c44a557d1b45e4bbe1b04258591 100644 (file)
@@ -232,7 +232,7 @@ static ngx_http_variable_t  ngx_http_geoip_vars[] = {
       ngx_http_geoip_city_int_variable,
       offsetof(GeoIPRecord, area_code), 0, 0 },
 
-    { ngx_null_string, NULL, NULL, 0, 0, 0 }
+      ngx_http_null_variable
 };
 
 
index 61bf55c157cb398c8294f3cb000fbe1631b28513..b42839c24a068cf32e4b5abf4359223a41a2f0ab 100644 (file)
@@ -829,7 +829,7 @@ static ngx_http_variable_t  ngx_http_proxy_vars[] = {
       ngx_http_proxy_internal_chunked_variable, 0,
       NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
 
-    { ngx_null_string, NULL, NULL, 0, 0, 0 }
+      ngx_http_null_variable
 };
 
 
index e1839e665d503eff449843d9470c9da9b4bb0ecd..7d3f2a91d1752bfd92a0e1871339ef4a25709c7b 100644 (file)
@@ -122,7 +122,7 @@ static ngx_http_variable_t  ngx_http_realip_vars[] = {
     { ngx_string("realip_remote_port"), NULL,
       ngx_http_realip_remote_port_variable, 0, 0, 0 },
 
-    { ngx_null_string, NULL, NULL, 0, 0, 0 }
+      ngx_http_null_variable
 };
 
 
index b09ce20614c0a8404d5a045169b70957b660cd84..e29e1739bbd81796e302960a447c6b19d08c7306 100644 (file)
@@ -321,7 +321,7 @@ static ngx_http_variable_t  ngx_http_ssi_vars[] = {
     { ngx_string("date_gmt"), NULL, ngx_http_ssi_date_gmt_local_variable, 1,
       NGX_HTTP_VAR_NOCACHEABLE, 0 },
 
-    { ngx_null_string, NULL, NULL, 0, 0, 0 }
+      ngx_http_null_variable
 };
 
 
index b466e5d9601992b3a3feb6936cea99b4430880ab..4370275be08d82379a0a4141dd3fd5fffed5c540 100644 (file)
@@ -329,7 +329,7 @@ static ngx_http_variable_t  ngx_http_ssl_vars[] = {
     { ngx_string("ssl_client_v_remain"), NULL, ngx_http_ssl_variable,
       (uintptr_t) ngx_ssl_get_client_v_remain, NGX_HTTP_VAR_CHANGEABLE, 0 },
 
-    { ngx_null_string, NULL, NULL, 0, 0, 0 }
+      ngx_http_null_variable
 };
 
 
index 61199f2fbb1f0e2d58124676869c33173a71d94f..9bdf88129db0d76289be21d19baff0dadcf080a3 100644 (file)
@@ -76,7 +76,7 @@ static ngx_http_variable_t  ngx_http_stub_status_vars[] = {
     { ngx_string("connections_waiting"), NULL, ngx_http_stub_status_variable,
       3, NGX_HTTP_VAR_NOCACHEABLE, 0 },
 
-    { ngx_null_string, NULL, NULL, 0, 0, 0 }
+      ngx_http_null_variable
 };
 
 
index fb3209270de89ae96ec974e46f0e7f80eac01076..6a2b32238af26f6f181565daf7e6d00f7b5cc876 100644 (file)
@@ -427,7 +427,7 @@ static ngx_http_variable_t  ngx_http_upstream_vars[] = {
     { ngx_string("upstream_cookie_"), NULL, ngx_http_upstream_cookie_variable,
       0, NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_PREFIX, 0 },
 
-    { ngx_null_string, NULL, NULL, 0, 0, 0 }
+      ngx_http_null_variable
 };
 
 
index fbc9ffafd6971cd2b42ba7677784cc0772e3bf14..afeb4ce65f06c02166a79d9635cc847640dce640 100644 (file)
@@ -376,7 +376,7 @@ static ngx_http_variable_t  ngx_http_core_variables[] = {
     { ngx_string("arg_"), NULL, ngx_http_variable_argument,
       0, NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_PREFIX, 0 },
 
-    { ngx_null_string, NULL, NULL, 0, 0, 0 }
+      ngx_http_null_variable
 };
 
 
index df337defc4d414c2ae85ca034acd6458259a34bf..f3f7f3c1ceed7a9a92f1c9154dc1a3b52abbf972 100644 (file)
@@ -43,6 +43,8 @@ struct ngx_http_variable_s {
     ngx_uint_t                    index;
 };
 
+#define ngx_http_null_variable  { ngx_null_string, NULL, NULL, 0, 0, 0 }
+
 
 ngx_http_variable_t *ngx_http_add_variable(ngx_conf_t *cf, ngx_str_t *name,
     ngx_uint_t flags);
index 032abcb64c74ebb8555ce794aeb75b7ec61fa563..7f7dab29e516399e906e83cd8379b315d6e9325b 100644 (file)
@@ -225,7 +225,7 @@ static ngx_http_variable_t  ngx_http_v2_vars[] = {
     { ngx_string("http2"), NULL,
       ngx_http_v2_variable, 0, 0, 0 },
 
-    { ngx_null_string, NULL, NULL, 0, 0, 0 }
+      ngx_http_null_variable
 };
 
 
index f694033cb4fbd5425cff3457e7d7d1b823219540..6507b716ec1a3ee2f00a93a2e290a44d0edeb989 100644 (file)
@@ -210,7 +210,7 @@ static ngx_stream_variable_t  ngx_stream_geoip_vars[] = {
       ngx_stream_geoip_city_int_variable,
       offsetof(GeoIPRecord, area_code), 0, 0 },
 
-    { ngx_null_string, NULL, NULL, 0, 0, 0 }
+      ngx_stream_null_variable
 };
 
 
index 1266605ce35a84e25316b5de5e4c7216c9bd23f2..57b1ac21e18d16e9e38bb6be53ea22ab5fdf15b7 100644 (file)
@@ -89,7 +89,7 @@ static ngx_stream_variable_t  ngx_stream_realip_vars[] = {
     { ngx_string("realip_remote_port"), NULL,
       ngx_stream_realip_remote_port_variable, 0, 0, 0 },
 
-    { ngx_null_string, NULL, NULL, 0, 0, 0 }
+      ngx_stream_null_variable
 };
 
 
index da26a41f7c80c6e633f9e4025994fa6ad93b9985..010b98b303258f989ade8810a91971db9d048efa 100644 (file)
@@ -273,7 +273,7 @@ static ngx_stream_variable_t  ngx_stream_ssl_vars[] = {
     { ngx_string("ssl_client_v_remain"), NULL, ngx_stream_ssl_variable,
       (uintptr_t) ngx_ssl_get_client_v_remain, NGX_STREAM_VAR_CHANGEABLE, 0 },
 
-    { ngx_null_string, NULL, NULL, 0, 0, 0 }
+      ngx_stream_null_variable
 };
 
 
index 2040b4fe83fab02b87acd10e98f7f8fd5241b21c..e3d11fd931e34ad90888c87a1f89ea16c6147058 100644 (file)
@@ -85,7 +85,7 @@ static ngx_stream_variable_t  ngx_stream_ssl_preread_vars[] = {
     { ngx_string("ssl_preread_server_name"), NULL,
       ngx_stream_ssl_preread_server_name_variable, 0, 0, 0 },
 
-    { ngx_null_string, NULL, NULL, 0, 0, 0 }
+      ngx_stream_null_variable
 };
 
 
index c9e17845e5bd2c59204be7923ae1c6369f90aa38..7feac4381dbbf1ef88ea21e3906aee7e1c81289f 100644 (file)
@@ -100,7 +100,7 @@ static ngx_stream_variable_t  ngx_stream_upstream_vars[] = {
       ngx_stream_upstream_bytes_variable, 1,
       NGX_STREAM_VAR_NOCACHEABLE, 0 },
 
-    { ngx_null_string, NULL, NULL, 0, 0, 0 }
+      ngx_stream_null_variable
 };
 
 
index 5d15f3a6dc20813ec71692a69ddfe179868f5b0b..45d6e60c84f124f4032f4855430017136a36b77c 100644 (file)
@@ -111,7 +111,7 @@ static ngx_stream_variable_t  ngx_stream_core_variables[] = {
     { ngx_string("protocol"), NULL,
       ngx_stream_variable_protocol, 0, 0, 0 },
 
-    { ngx_null_string, NULL, NULL, 0, 0, 0 }
+      ngx_stream_null_variable
 };
 
 
index 81551115457336d94e530cf2321c678426f89a6c..4ead2a6240d8a105e2c33587be1b30c9af076458 100644 (file)
@@ -43,6 +43,8 @@ struct ngx_stream_variable_s {
     ngx_uint_t                    index;
 };
 
+#define ngx_stream_null_variable  { ngx_null_string, NULL, NULL, 0, 0, 0 }
+
 
 ngx_stream_variable_t *ngx_stream_add_variable(ngx_conf_t *cf, ngx_str_t *name,
     ngx_uint_t flags);