summaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-01-10 06:09:20 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-01-10 06:09:20 +0000
commitb2620634c5c395f227a98837f46e1eaf6b86963c (patch)
treed9333eef73b09e7351cdc8705df984786a5544b3 /src/core
parent4e9393a0548d783cd6f50d1fcd003c85a24b2b16 (diff)
downloadnginx-b2620634c5c395f227a98837f46e1eaf6b86963c.tar.gz
nginx-b2620634c5c395f227a98837f46e1eaf6b86963c.tar.bz2
nginx-0.0.1-2003-01-10-09:09:20 import
Diffstat (limited to 'src/core')
-rw-r--r--src/core/nginx.c13
-rw-r--r--src/core/ngx_conf_file.c2
-rw-r--r--src/core/ngx_conf_file.h1
-rw-r--r--src/core/ngx_string.h1
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