Mercurial > hg > nginx-quic
comparison src/http/ngx_http_core_module.c @ 2195:a953f73273ee
server_name "" support
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 21 Aug 2008 12:56:10 +0000 |
parents | ecce31d90117 |
children | 74477ea8074f |
comparison
equal
deleted
inserted
replaced
2194:d3f833da6b65 | 2195:a953f73273ee |
---|---|
3092 | 3092 |
3093 value = cf->args->elts; | 3093 value = cf->args->elts; |
3094 | 3094 |
3095 ch = value[1].data[0]; | 3095 ch = value[1].data[0]; |
3096 | 3096 |
3097 if (cscf->server_name.data == NULL && value[1].len) { | 3097 if (cscf->server_name.data == NULL) { |
3098 name = value[1]; | 3098 if (value[1].len) { |
3099 | 3099 name = value[1]; |
3100 if (ch == '.') { | 3100 |
3101 name.len--; | 3101 if (ch == '.') { |
3102 name.data++; | 3102 name.len--; |
3103 } | 3103 name.data++; |
3104 | 3104 } |
3105 cscf->server_name.len = name.len; | 3105 |
3106 cscf->server_name.data = ngx_pstrdup(cf->pool, &name); | 3106 cscf->server_name.len = name.len; |
3107 if (cscf->server_name.data == NULL) { | 3107 cscf->server_name.data = ngx_pstrdup(cf->pool, &name); |
3108 if (cscf->server_name.data == NULL) { | |
3109 return NGX_CONF_ERROR; | |
3110 } | |
3111 | |
3112 } else { | |
3113 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
3114 "the first server name must not be empty"); | |
3108 return NGX_CONF_ERROR; | 3115 return NGX_CONF_ERROR; |
3109 } | 3116 } |
3110 } | 3117 } |
3111 | 3118 |
3112 for (i = 1; i < cf->args->nelts; i++) { | 3119 for (i = 1; i < cf->args->nelts; i++) { |
3113 | 3120 |
3114 ch = value[i].data[0]; | 3121 ch = value[i].data[0]; |
3115 | 3122 |
3116 if (value[i].len == 0 | 3123 if ((ch == '*' && (value[i].len < 3 || value[i].data[1] != '.')) |
3117 || (ch == '*' && (value[i].len < 3 || value[i].data[1] != '.')) | |
3118 || (ch == '.' && value[i].len < 2)) | 3124 || (ch == '.' && value[i].len < 2)) |
3119 { | 3125 { |
3120 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | 3126 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
3121 "server name \"%V\" is invalid", &value[i]); | 3127 "server name \"%V\" is invalid", &value[i]); |
3122 return NGX_CONF_ERROR; | 3128 return NGX_CONF_ERROR; |