]> git.kaiwu.me - nginx.git/commitdiff
*) introduce ngx_strchr()
authorIgor Sysoev <igor@sysoev.ru>
Mon, 2 Apr 2007 06:27:30 +0000 (06:27 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 2 Apr 2007 06:27:30 +0000 (06:27 +0000)
*) test server_name for '/': it's common configuration error when
   trailing ';' is omitted and a next directive is treated as server_name

src/core/ngx_string.h
src/http/ngx_http_core_module.c

index 15650009c8ff4e77c3b173a5d5e717b45d0c1cb8..db7857a362978da5f68cc93e02bcfb9ce61594fb 100644 (file)
@@ -40,6 +40,7 @@ typedef struct {
 
 
 #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)
 
 
index 49eed1b038c3dc5418f6be585bc3100ebecc5b15..7fa0ba3470d5fa4dd5b4008df71a86caf7516263 100644 (file)
@@ -2614,6 +2614,12 @@ ngx_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
             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;