# HG changeset patch # User Ruslan Ermilov # Date 1501586913 -10800 # Node ID 2a288909abc634d2b4635de025f33f9c6bf39a91 # Parent 1b82e86dd3e71d96b27e3c72e93d04a1d2dab194 Variables: macros for null variables. No functional changes. diff -r 1b82e86dd3e7 -r 2a288909abc6 src/http/modules/ngx_http_browser_module.c --- a/src/http/modules/ngx_http_browser_module.c Tue Aug 01 14:27:23 2017 +0300 +++ b/src/http/modules/ngx_http_browser_module.c Tue Aug 01 14:28:33 2017 +0300 @@ -222,7 +222,7 @@ { 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 }; diff -r 1b82e86dd3e7 -r 2a288909abc6 src/http/modules/ngx_http_fastcgi_module.c --- a/src/http/modules/ngx_http_fastcgi_module.c Tue Aug 01 14:27:23 2017 +0300 +++ b/src/http/modules/ngx_http_fastcgi_module.c Tue Aug 01 14:28:33 2017 +0300 @@ -631,7 +631,7 @@ 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 }; diff -r 1b82e86dd3e7 -r 2a288909abc6 src/http/modules/ngx_http_geoip_module.c --- a/src/http/modules/ngx_http_geoip_module.c Tue Aug 01 14:27:23 2017 +0300 +++ b/src/http/modules/ngx_http_geoip_module.c Tue Aug 01 14:28:33 2017 +0300 @@ -232,7 +232,7 @@ ngx_http_geoip_city_int_variable, offsetof(GeoIPRecord, area_code), 0, 0 }, - { ngx_null_string, NULL, NULL, 0, 0, 0 } + ngx_http_null_variable }; diff -r 1b82e86dd3e7 -r 2a288909abc6 src/http/modules/ngx_http_proxy_module.c --- a/src/http/modules/ngx_http_proxy_module.c Tue Aug 01 14:27:23 2017 +0300 +++ b/src/http/modules/ngx_http_proxy_module.c Tue Aug 01 14:28:33 2017 +0300 @@ -829,7 +829,7 @@ 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 }; diff -r 1b82e86dd3e7 -r 2a288909abc6 src/http/modules/ngx_http_realip_module.c --- a/src/http/modules/ngx_http_realip_module.c Tue Aug 01 14:27:23 2017 +0300 +++ b/src/http/modules/ngx_http_realip_module.c Tue Aug 01 14:28:33 2017 +0300 @@ -122,7 +122,7 @@ { 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 }; diff -r 1b82e86dd3e7 -r 2a288909abc6 src/http/modules/ngx_http_ssi_filter_module.c --- a/src/http/modules/ngx_http_ssi_filter_module.c Tue Aug 01 14:27:23 2017 +0300 +++ b/src/http/modules/ngx_http_ssi_filter_module.c Tue Aug 01 14:28:33 2017 +0300 @@ -321,7 +321,7 @@ { 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 }; diff -r 1b82e86dd3e7 -r 2a288909abc6 src/http/modules/ngx_http_ssl_module.c --- a/src/http/modules/ngx_http_ssl_module.c Tue Aug 01 14:27:23 2017 +0300 +++ b/src/http/modules/ngx_http_ssl_module.c Tue Aug 01 14:28:33 2017 +0300 @@ -329,7 +329,7 @@ { 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 }; diff -r 1b82e86dd3e7 -r 2a288909abc6 src/http/modules/ngx_http_stub_status_module.c --- a/src/http/modules/ngx_http_stub_status_module.c Tue Aug 01 14:27:23 2017 +0300 +++ b/src/http/modules/ngx_http_stub_status_module.c Tue Aug 01 14:28:33 2017 +0300 @@ -76,7 +76,7 @@ { 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 }; diff -r 1b82e86dd3e7 -r 2a288909abc6 src/http/ngx_http_upstream.c --- a/src/http/ngx_http_upstream.c Tue Aug 01 14:27:23 2017 +0300 +++ b/src/http/ngx_http_upstream.c Tue Aug 01 14:28:33 2017 +0300 @@ -427,7 +427,7 @@ { 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 }; diff -r 1b82e86dd3e7 -r 2a288909abc6 src/http/ngx_http_variables.c --- a/src/http/ngx_http_variables.c Tue Aug 01 14:27:23 2017 +0300 +++ b/src/http/ngx_http_variables.c Tue Aug 01 14:28:33 2017 +0300 @@ -376,7 +376,7 @@ { 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 }; diff -r 1b82e86dd3e7 -r 2a288909abc6 src/http/ngx_http_variables.h --- a/src/http/ngx_http_variables.h Tue Aug 01 14:27:23 2017 +0300 +++ b/src/http/ngx_http_variables.h Tue Aug 01 14:28:33 2017 +0300 @@ -43,6 +43,8 @@ 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); diff -r 1b82e86dd3e7 -r 2a288909abc6 src/http/v2/ngx_http_v2_module.c --- a/src/http/v2/ngx_http_v2_module.c Tue Aug 01 14:27:23 2017 +0300 +++ b/src/http/v2/ngx_http_v2_module.c Tue Aug 01 14:28:33 2017 +0300 @@ -225,7 +225,7 @@ { ngx_string("http2"), NULL, ngx_http_v2_variable, 0, 0, 0 }, - { ngx_null_string, NULL, NULL, 0, 0, 0 } + ngx_http_null_variable }; diff -r 1b82e86dd3e7 -r 2a288909abc6 src/stream/ngx_stream_geoip_module.c --- a/src/stream/ngx_stream_geoip_module.c Tue Aug 01 14:27:23 2017 +0300 +++ b/src/stream/ngx_stream_geoip_module.c Tue Aug 01 14:28:33 2017 +0300 @@ -210,7 +210,7 @@ ngx_stream_geoip_city_int_variable, offsetof(GeoIPRecord, area_code), 0, 0 }, - { ngx_null_string, NULL, NULL, 0, 0, 0 } + ngx_stream_null_variable }; diff -r 1b82e86dd3e7 -r 2a288909abc6 src/stream/ngx_stream_realip_module.c --- a/src/stream/ngx_stream_realip_module.c Tue Aug 01 14:27:23 2017 +0300 +++ b/src/stream/ngx_stream_realip_module.c Tue Aug 01 14:28:33 2017 +0300 @@ -89,7 +89,7 @@ { 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 }; diff -r 1b82e86dd3e7 -r 2a288909abc6 src/stream/ngx_stream_ssl_module.c --- a/src/stream/ngx_stream_ssl_module.c Tue Aug 01 14:27:23 2017 +0300 +++ b/src/stream/ngx_stream_ssl_module.c Tue Aug 01 14:28:33 2017 +0300 @@ -273,7 +273,7 @@ { 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 }; diff -r 1b82e86dd3e7 -r 2a288909abc6 src/stream/ngx_stream_ssl_preread_module.c --- a/src/stream/ngx_stream_ssl_preread_module.c Tue Aug 01 14:27:23 2017 +0300 +++ b/src/stream/ngx_stream_ssl_preread_module.c Tue Aug 01 14:28:33 2017 +0300 @@ -85,7 +85,7 @@ { 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 }; diff -r 1b82e86dd3e7 -r 2a288909abc6 src/stream/ngx_stream_upstream.c --- a/src/stream/ngx_stream_upstream.c Tue Aug 01 14:27:23 2017 +0300 +++ b/src/stream/ngx_stream_upstream.c Tue Aug 01 14:28:33 2017 +0300 @@ -100,7 +100,7 @@ ngx_stream_upstream_bytes_variable, 1, NGX_STREAM_VAR_NOCACHEABLE, 0 }, - { ngx_null_string, NULL, NULL, 0, 0, 0 } + ngx_stream_null_variable }; diff -r 1b82e86dd3e7 -r 2a288909abc6 src/stream/ngx_stream_variables.c --- a/src/stream/ngx_stream_variables.c Tue Aug 01 14:27:23 2017 +0300 +++ b/src/stream/ngx_stream_variables.c Tue Aug 01 14:28:33 2017 +0300 @@ -111,7 +111,7 @@ { ngx_string("protocol"), NULL, ngx_stream_variable_protocol, 0, 0, 0 }, - { ngx_null_string, NULL, NULL, 0, 0, 0 } + ngx_stream_null_variable }; diff -r 1b82e86dd3e7 -r 2a288909abc6 src/stream/ngx_stream_variables.h --- a/src/stream/ngx_stream_variables.h Tue Aug 01 14:27:23 2017 +0300 +++ b/src/stream/ngx_stream_variables.h Tue Aug 01 14:28:33 2017 +0300 @@ -43,6 +43,8 @@ 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);