diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/nginx.c | 13 | ||||
| -rw-r--r-- | src/core/ngx_conf_file.c | 2 | ||||
| -rw-r--r-- | src/core/ngx_conf_file.h | 1 | ||||
| -rw-r--r-- | src/core/ngx_string.h | 1 |
4 files changed, 15 insertions, 2 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c index ead14530a..5652e4167 100644 --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -3,6 +3,7 @@ #include <ngx_config.h> +#include <ngx_core.h> #include <ngx_string.h> #include <ngx_errno.h> #include <ngx_time.h> @@ -41,6 +42,7 @@ ngx_array_t ngx_listening_sockets; int main(int argc, char *const *argv) { + int i; ngx_str_t conf_file; ngx_conf_t conf; @@ -70,9 +72,18 @@ int main(int argc, char *const *argv) conf_file.data = "nginx.conf"; if (ngx_conf_parse(&conf, &conf_file) != NGX_CONF_OK) { - exit(1); + return 1; + } + + for (i = 0; ngx_modules[i]; i++) { + if (ngx_modules[i]->init_module) { + if (ngx_modules[i]->init_module(ngx_pool) == NGX_ERROR) { + return 1; + } + } } + #if 0 /* STUB */ /* TODO: init chain of global modules (like ngx_http.c), diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c index 70cb551dc..df0f5b244 100644 --- a/src/core/ngx_conf_file.c +++ b/src/core/ngx_conf_file.c @@ -83,7 +83,7 @@ ngx_log_debug(cf->log, "token %d" _ rc); found = 0; for (i = 0; !found && ngx_modules[i]; i++) { - if (ngx_modules[i]->type != NULL + if (ngx_modules[i]->type != NGX_CONF_MODULE_TYPE && ngx_modules[i]->type != cf->type) { continue; diff --git a/src/core/ngx_conf_file.h b/src/core/ngx_conf_file.h index 77f6b4086..de85a74c8 100644 --- a/src/core/ngx_conf_file.h +++ b/src/core/ngx_conf_file.h @@ -31,6 +31,7 @@ #define NGX_CORE_MODULE_TYPE 0x45524f43 /* "CORE" */ +#define NGX_CONF_MODULE_TYPE 0x464E4f43 /* "CONF" */ typedef struct ngx_conf_s ngx_conf_t; diff --git a/src/core/ngx_string.h b/src/core/ngx_string.h index 503ffad43..193308452 100644 --- a/src/core/ngx_string.h +++ b/src/core/ngx_string.h @@ -29,6 +29,7 @@ typedef struct { #define ngx_memzero bzero +#define ngx_strcasecmp strcasecmp #define ngx_strncmp strncmp #define ngx_strcmp strcmp |
