diff src/http/modules/ngx_http_auth_basic_module.c @ 4947:4251e72b8bb4

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.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 06 Dec 2012 23:03:53 +0000
parents d620f497c50f
children d03712b6914b
line wrap: on
line diff
--- a/src/http/modules/ngx_http_auth_basic_module.c
+++ b/src/http/modules/ngx_http_auth_basic_module.c
@@ -117,7 +117,7 @@ ngx_http_auth_basic_handler(ngx_http_req
 
     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 @@ ngx_http_auth_basic_merge_loc_conf(ngx_c
         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_http_auth_basic_user_file(ngx_conf_t
     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";
     }