nginx-0.0.1-2003-05-14-21:13:13 import
diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c
index a93922a..b8bbc52 100644
--- a/src/core/ngx_conf_file.c
+++ b/src/core/ngx_conf_file.c
@@ -76,11 +76,21 @@
if (cf->handler) {
- if ((*cf->handler)(cf) == NGX_CONF_ERROR) {
+ rv = (*cf->handler)(cf, NULL, cf->handler_conf);
+ if (rv == NGX_CONF_OK) {
+ continue;
+
+ } else if (rv == NGX_CONF_ERROR) {
+ return NGX_CONF_ERROR;
+
+ } else {
+ ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
+ "%s %s in %s:%d",
+ name->data, rv,
+ cf->conf_file->file.name.data,
+ cf->conf_file->line);
return NGX_CONF_ERROR;
}
-
- continue;
}
name = (ngx_str_t *) cf->args->elts;
@@ -88,7 +98,7 @@
for (i = 0; !found && ngx_modules[i]; i++) {
if (ngx_modules[i]->type != NGX_CONF_MODULE_TYPE
- && ngx_modules[i]->type != cf->type)
+ && ngx_modules[i]->type != cf->module_type)
{
continue;
}
@@ -107,6 +117,16 @@
ngx_log_debug(cf->log, "command '%s'" _ cmd->name.data);
#endif
+ if ((cmd->type & cf->cmd_type) == 0) {
+ ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
+ "directive \"%s\" in %s:%d "
+ "is not allowed here",
+ name->data,
+ cf->conf_file->file.name.data,
+ cf->conf_file->line);
+ return NGX_CONF_ERROR;
+ }
+
if (!(cmd->type & NGX_CONF_ANY)
&& ((cmd->type & NGX_CONF_FLAG && cf->args->nelts != 2)
|| (!(cmd->type & NGX_CONF_FLAG)