diff src/core/ngx_conf_file.c @ 682:5cb5db9975ba NGINX_1_3_4

nginx 1.3.4 *) Change: the "ipv6only" parameter is now turned on by default for listening IPv6 sockets. *) Feature: the Clang compiler support. *) Bugfix: extra listening sockets might be created. Thanks to Roman Odaisky. *) Bugfix: nginx/Windows might hog CPU if a worker process failed to start. Thanks to Ricardo Villalobos Guevara. *) Bugfix: the "proxy_pass_header", "fastcgi_pass_header", "scgi_pass_header", "uwsgi_pass_header", "proxy_hide_header", "fastcgi_hide_header", "scgi_hide_header", and "uwsgi_hide_header" directives might be inherited incorrectly.
author Igor Sysoev <http://sysoev.ru>
date Tue, 31 Jul 2012 00:00:00 +0400
parents f41d4b305d22
children 2e8a942c8872
line wrap: on
line diff
--- a/src/core/ngx_conf_file.c
+++ b/src/core/ngx_conf_file.c
@@ -282,24 +282,16 @@ ngx_conf_handler(ngx_conf_t *cf, ngx_int
 {
     char           *rv;
     void           *conf, **confp;
-    ngx_uint_t      i, multi;
+    ngx_uint_t      i, found;
     ngx_str_t      *name;
     ngx_command_t  *cmd;
 
     name = cf->args->elts;
 
-    multi = 0;
+    found = 0;
 
     for (i = 0; ngx_modules[i]; i++) {
 
-        /* look up the directive in the appropriate modules */
-
-        if (ngx_modules[i]->type != NGX_CONF_MODULE
-            && ngx_modules[i]->type != cf->module_type)
-        {
-            continue;
-        }
-
         cmd = ngx_modules[i]->commands;
         if (cmd == NULL) {
             continue;
@@ -315,16 +307,18 @@ ngx_conf_handler(ngx_conf_t *cf, ngx_int
                 continue;
             }
 
+            found = 1;
+
+            if (ngx_modules[i]->type != NGX_CONF_MODULE
+                && ngx_modules[i]->type != cf->module_type)
+            {
+                continue;
+            }
 
             /* is the directive's location right ? */
 
             if (!(cmd->type & cf->cmd_type)) {
-                if (cmd->type & NGX_CONF_MULTI) {
-                    multi = 1;
-                    continue;
-                }
-
-                goto not_allowed;
+                continue;
             }
 
             if (!(cmd->type & NGX_CONF_BLOCK) && last != NGX_OK) {
@@ -408,17 +402,16 @@ ngx_conf_handler(ngx_conf_t *cf, ngx_int
         }
     }
 
-    if (multi == 0) {
+    if (found) {
         ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-                           "unknown directive \"%s\"", name->data);
+                           "\"%s\" directive is not allowed here", name->data);
 
         return NGX_ERROR;
     }
 
-not_allowed:
+    ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+                       "unknown directive \"%s\"", name->data);
 
-    ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-                       "\"%s\" directive is not allowed here", name->data);
     return NGX_ERROR;
 
 invalid:
@@ -1448,12 +1441,16 @@ ngx_conf_set_bitmask_slot(ngx_conf_t *cf
 }
 
 
+#if 0
+
 char *
 ngx_conf_unsupported(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
     return "unsupported on this platform";
 }
 
+#endif
+
 
 char *
 ngx_conf_deprecated(ngx_conf_t *cf, void *post, void *data)