aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_conf_file.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-05-14 17:13:13 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-05-14 17:13:13 +0000
commit79a804880ee362a1256e6e8aeadb73f7f5cf0885 (patch)
tree72ab5081ebb0a198288f706be81defbb4664e5ae /src/core/ngx_conf_file.c
parentd581fd58e11724df8d7a9d748f9fc3ab66911a5f (diff)
downloadnginx-79a804880ee362a1256e6e8aeadb73f7f5cf0885.tar.gz
nginx-79a804880ee362a1256e6e8aeadb73f7f5cf0885.zip
nginx-0.0.1-2003-05-14-21:13:13 import
Diffstat (limited to 'src/core/ngx_conf_file.c')
-rw-r--r--src/core/ngx_conf_file.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c
index a93922a04..b8bbc5224 100644
--- a/src/core/ngx_conf_file.c
+++ b/src/core/ngx_conf_file.c
@@ -76,11 +76,21 @@ ngx_log_debug(cf->log, "token %d" _ rc);
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;
- }
- continue;
+ } 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;
+ }
}
name = (ngx_str_t *) cf->args->elts;
@@ -88,7 +98,7 @@ ngx_log_debug(cf->log, "token %d" _ rc);
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, "token %d" _ rc);
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)