Allow the complex value to be defined as an empty string.
This makes conversion from strings to complex values possible
without the loss of functionality.
diff --git a/src/http/modules/ngx_http_auth_basic_module.c b/src/http/modules/ngx_http_auth_basic_module.c
index ec3b1cf..285fb76 100644
--- a/src/http/modules/ngx_http_auth_basic_module.c
+++ b/src/http/modules/ngx_http_auth_basic_module.c
@@ -117,7 +117,7 @@
alcf = ngx_http_get_module_loc_conf(r, ngx_http_auth_basic_module);
- if (alcf->realm.len == 0 || alcf->user_file.value.len == 0) {
+ if (alcf->realm.len == 0 || alcf->user_file.value.data == NULL) {
return NGX_DECLINED;
}
@@ -390,7 +390,7 @@
conf->realm = prev->realm;
}
- if (conf->user_file.value.len == 0) {
+ if (conf->user_file.value.data == NULL) {
conf->user_file = prev->user_file;
}
@@ -456,7 +456,7 @@
ngx_str_t *value;
ngx_http_compile_complex_value_t ccv;
- if (alcf->user_file.value.len) {
+ if (alcf->user_file.value.data) {
return "is duplicate";
}
diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c
index e8ff24c..f1917e2 100644
--- a/src/http/modules/ngx_http_fastcgi_module.c
+++ b/src/http/modules/ngx_http_fastcgi_module.c
@@ -3014,7 +3014,7 @@
value = cf->args->elts;
- if (flcf->cache_key.value.len) {
+ if (flcf->cache_key.value.data) {
return "is duplicate";
}
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c
index b1b8f46..541c59f 100644
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -837,7 +837,7 @@
return NGX_ERROR;
}
- if (plcf->cache_key.value.len) {
+ if (plcf->cache_key.value.data) {
if (ngx_http_complex_value(r, &plcf->cache_key, key) != NGX_OK) {
return NGX_ERROR;
@@ -3651,7 +3651,7 @@
value = cf->args->elts;
- if (plcf->cache_key.value.len) {
+ if (plcf->cache_key.value.data) {
return "is duplicate";
}
diff --git a/src/http/modules/ngx_http_scgi_module.c b/src/http/modules/ngx_http_scgi_module.c
index 2c825fa..5a3af92 100644
--- a/src/http/modules/ngx_http_scgi_module.c
+++ b/src/http/modules/ngx_http_scgi_module.c
@@ -1771,7 +1771,7 @@
value = cf->args->elts;
- if (scf->cache_key.value.len) {
+ if (scf->cache_key.value.data) {
return "is duplicate";
}
diff --git a/src/http/modules/ngx_http_sub_filter_module.c b/src/http/modules/ngx_http_sub_filter_module.c
index 989adf5..6ba57df 100644
--- a/src/http/modules/ngx_http_sub_filter_module.c
+++ b/src/http/modules/ngx_http_sub_filter_module.c
@@ -628,7 +628,7 @@
ngx_str_t *value;
ngx_http_compile_complex_value_t ccv;
- if (slcf->match.len) {
+ if (slcf->match.data) {
return "is duplicate";
}
@@ -688,7 +688,7 @@
ngx_conf_merge_value(conf->once, prev->once, 1);
ngx_conf_merge_str_value(conf->match, prev->match, "");
- if (conf->value.value.len == 0) {
+ if (conf->value.value.data == NULL) {
conf->value = prev->value;
}
diff --git a/src/http/modules/ngx_http_uwsgi_module.c b/src/http/modules/ngx_http_uwsgi_module.c
index ef8994c..0c6414c 100644
--- a/src/http/modules/ngx_http_uwsgi_module.c
+++ b/src/http/modules/ngx_http_uwsgi_module.c
@@ -1807,7 +1807,7 @@
value = cf->args->elts;
- if (uwcf->cache_key.value.len) {
+ if (uwcf->cache_key.value.data) {
return "is duplicate";
}