comparison src/http/ngx_http_core_module.c @ 6941:6e20a6479325

Simplified code about duplicate root/alias directive.
author Ruslan Ermilov <ru@nginx.com>
date Wed, 22 Mar 2017 23:36:35 +0300
parents 39ff6939266e
children 3fb9b5eb75c0
comparison
equal deleted inserted replaced
6940:39ff6939266e 6941:6e20a6479325
4403 alias = (cmd->name.len == sizeof("alias") - 1) ? 1 : 0; 4403 alias = (cmd->name.len == sizeof("alias") - 1) ? 1 : 0;
4404 4404
4405 if (clcf->root.data) { 4405 if (clcf->root.data) {
4406 4406
4407 if ((clcf->alias != 0) == alias) { 4407 if ((clcf->alias != 0) == alias) {
4408 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 4408 return "is duplicate";
4409 "\"%V\" directive is duplicate", 4409 }
4410 &cmd->name); 4410
4411 } else { 4411 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
4412 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 4412 "\"%V\" directive is duplicate, "
4413 "\"%V\" directive is duplicate, " 4413 "\"%s\" directive was specified earlier",
4414 "\"%s\" directive was specified earlier", 4414 &cmd->name, clcf->alias ? "alias" : "root");
4415 &cmd->name, clcf->alias ? "alias" : "root");
4416 }
4417 4415
4418 return NGX_CONF_ERROR; 4416 return NGX_CONF_ERROR;
4419 } 4417 }
4420 4418
4421 if (clcf->named && alias) { 4419 if (clcf->named && alias) {