Mercurial > hg > nginx
comparison src/core/ngx_conf_file.c @ 88:674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 14 May 2003 17:13:13 +0000 |
parents | fab4cb00fe5b |
children | 29bf798b583f |
comparison
equal
deleted
inserted
replaced
87:5f6d848dcbef | 88:674d333f4296 |
---|---|
74 return NGX_CONF_OK; | 74 return NGX_CONF_OK; |
75 } | 75 } |
76 | 76 |
77 if (cf->handler) { | 77 if (cf->handler) { |
78 | 78 |
79 if ((*cf->handler)(cf) == NGX_CONF_ERROR) { | 79 rv = (*cf->handler)(cf, NULL, cf->handler_conf); |
80 if (rv == NGX_CONF_OK) { | |
81 continue; | |
82 | |
83 } else if (rv == NGX_CONF_ERROR) { | |
80 return NGX_CONF_ERROR; | 84 return NGX_CONF_ERROR; |
81 } | 85 |
82 | 86 } else { |
83 continue; | 87 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, |
88 "%s %s in %s:%d", | |
89 name->data, rv, | |
90 cf->conf_file->file.name.data, | |
91 cf->conf_file->line); | |
92 return NGX_CONF_ERROR; | |
93 } | |
84 } | 94 } |
85 | 95 |
86 name = (ngx_str_t *) cf->args->elts; | 96 name = (ngx_str_t *) cf->args->elts; |
87 found = 0; | 97 found = 0; |
88 | 98 |
89 for (i = 0; !found && ngx_modules[i]; i++) { | 99 for (i = 0; !found && ngx_modules[i]; i++) { |
90 if (ngx_modules[i]->type != NGX_CONF_MODULE_TYPE | 100 if (ngx_modules[i]->type != NGX_CONF_MODULE_TYPE |
91 && ngx_modules[i]->type != cf->type) | 101 && ngx_modules[i]->type != cf->module_type) |
92 { | 102 { |
93 continue; | 103 continue; |
94 } | 104 } |
95 | 105 |
96 cmd = ngx_modules[i]->commands; | 106 cmd = ngx_modules[i]->commands; |
104 { | 114 { |
105 | 115 |
106 #if 0 | 116 #if 0 |
107 ngx_log_debug(cf->log, "command '%s'" _ cmd->name.data); | 117 ngx_log_debug(cf->log, "command '%s'" _ cmd->name.data); |
108 #endif | 118 #endif |
119 | |
120 if ((cmd->type & cf->cmd_type) == 0) { | |
121 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, | |
122 "directive \"%s\" in %s:%d " | |
123 "is not allowed here", | |
124 name->data, | |
125 cf->conf_file->file.name.data, | |
126 cf->conf_file->line); | |
127 return NGX_CONF_ERROR; | |
128 } | |
109 | 129 |
110 if (!(cmd->type & NGX_CONF_ANY) | 130 if (!(cmd->type & NGX_CONF_ANY) |
111 && ((cmd->type & NGX_CONF_FLAG && cf->args->nelts != 2) | 131 && ((cmd->type & NGX_CONF_FLAG && cf->args->nelts != 2) |
112 || (!(cmd->type & NGX_CONF_FLAG) | 132 || (!(cmd->type & NGX_CONF_FLAG) |
113 && !(cmd->type | 133 && !(cmd->type |