comparison 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
comparison
equal deleted inserted replaced
4946:2570296374b4 4947:4251e72b8bb4
115 sw_skip 115 sw_skip
116 } state; 116 } state;
117 117
118 alcf = ngx_http_get_module_loc_conf(r, ngx_http_auth_basic_module); 118 alcf = ngx_http_get_module_loc_conf(r, ngx_http_auth_basic_module);
119 119
120 if (alcf->realm.len == 0 || alcf->user_file.value.len == 0) { 120 if (alcf->realm.len == 0 || alcf->user_file.value.data == NULL) {
121 return NGX_DECLINED; 121 return NGX_DECLINED;
122 } 122 }
123 123
124 ctx = ngx_http_get_module_ctx(r, ngx_http_auth_basic_module); 124 ctx = ngx_http_get_module_ctx(r, ngx_http_auth_basic_module);
125 125
388 388
389 if (conf->realm.data == NULL) { 389 if (conf->realm.data == NULL) {
390 conf->realm = prev->realm; 390 conf->realm = prev->realm;
391 } 391 }
392 392
393 if (conf->user_file.value.len == 0) { 393 if (conf->user_file.value.data == NULL) {
394 conf->user_file = prev->user_file; 394 conf->user_file = prev->user_file;
395 } 395 }
396 396
397 return NGX_CONF_OK; 397 return NGX_CONF_OK;
398 } 398 }
454 ngx_http_auth_basic_loc_conf_t *alcf = conf; 454 ngx_http_auth_basic_loc_conf_t *alcf = conf;
455 455
456 ngx_str_t *value; 456 ngx_str_t *value;
457 ngx_http_compile_complex_value_t ccv; 457 ngx_http_compile_complex_value_t ccv;
458 458
459 if (alcf->user_file.value.len) { 459 if (alcf->user_file.value.data) {
460 return "is duplicate"; 460 return "is duplicate";
461 } 461 }
462 462
463 value = cf->args->elts; 463 value = cf->args->elts;
464 464