# HG changeset patch # User Igor Sysoev # Date 1175495250 0 # Node ID a4820184a61882f58814f98da10de90dbc0890e4 # Parent a9005d2e2c99681ddaa1a06bf73013f1988cdbd8 *) introduce ngx_strchr() *) test server_name for '/': it's common configuration error when trailing ';' is omitted and a next directive is treated as server_name diff -r a9005d2e2c99 -r a4820184a618 src/core/ngx_string.h --- a/src/core/ngx_string.h Mon Apr 02 05:43:21 2007 +0000 +++ b/src/core/ngx_string.h Mon Apr 02 06:27:30 2007 +0000 @@ -40,6 +40,7 @@ #define ngx_strstr(s1, s2) strstr((const char *) s1, (const char *) s2) +#define ngx_strchr(s1, c) strchr((const char *) s1, (int) c) #define ngx_strlen(s) strlen((const char *) s) diff -r a9005d2e2c99 -r a4820184a618 src/http/ngx_http_core_module.c --- a/src/http/ngx_http_core_module.c Mon Apr 02 05:43:21 2007 +0000 +++ b/src/http/ngx_http_core_module.c Mon Apr 02 06:27:30 2007 +0000 @@ -2614,6 +2614,12 @@ return NGX_CONF_ERROR; } + if (ngx_strchr(value[i].data, '/')) { + ngx_conf_log_error(NGX_LOG_WARN, cf, 0, + "server name \"%V\" has strange symbols", + &value[i]); + } + sn = ngx_array_push(&cscf->server_names); if (sn == NULL) { return NGX_CONF_ERROR;