Mercurial > hg > nginx
comparison src/core/nginx.c @ 45:f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 10 Jan 2003 06:09:20 +0000 |
parents | 0e81ac0bb3e2 |
children | 6b13b1cadabe |
comparison
equal
deleted
inserted
replaced
44:0e81ac0bb3e2 | 45:f1ee46c036a4 |
---|---|
1 | 1 |
2 #include <nginx.h> | 2 #include <nginx.h> |
3 | 3 |
4 #include <ngx_config.h> | 4 #include <ngx_config.h> |
5 | 5 |
6 #include <ngx_core.h> | |
6 #include <ngx_string.h> | 7 #include <ngx_string.h> |
7 #include <ngx_errno.h> | 8 #include <ngx_errno.h> |
8 #include <ngx_time.h> | 9 #include <ngx_time.h> |
9 #include <ngx_log.h> | 10 #include <ngx_log.h> |
10 #include <ngx_alloc.h> | 11 #include <ngx_alloc.h> |
39 ngx_array_t ngx_listening_sockets; | 40 ngx_array_t ngx_listening_sockets; |
40 | 41 |
41 | 42 |
42 int main(int argc, char *const *argv) | 43 int main(int argc, char *const *argv) |
43 { | 44 { |
45 int i; | |
44 ngx_str_t conf_file; | 46 ngx_str_t conf_file; |
45 ngx_conf_t conf; | 47 ngx_conf_t conf; |
46 | 48 |
47 /* STUB */ | 49 /* STUB */ |
48 ngx_log.log_level = NGX_LOG_DEBUG; | 50 ngx_log.log_level = NGX_LOG_DEBUG; |
68 | 70 |
69 conf_file.len = sizeof("nginx.conf") - 1; | 71 conf_file.len = sizeof("nginx.conf") - 1; |
70 conf_file.data = "nginx.conf"; | 72 conf_file.data = "nginx.conf"; |
71 | 73 |
72 if (ngx_conf_parse(&conf, &conf_file) != NGX_CONF_OK) { | 74 if (ngx_conf_parse(&conf, &conf_file) != NGX_CONF_OK) { |
73 exit(1); | 75 return 1; |
74 } | 76 } |
77 | |
78 for (i = 0; ngx_modules[i]; i++) { | |
79 if (ngx_modules[i]->init_module) { | |
80 if (ngx_modules[i]->init_module(ngx_pool) == NGX_ERROR) { | |
81 return 1; | |
82 } | |
83 } | |
84 } | |
85 | |
75 | 86 |
76 #if 0 | 87 #if 0 |
77 /* STUB */ | 88 /* STUB */ |
78 /* TODO: init chain of global modules (like ngx_http.c), | 89 /* TODO: init chain of global modules (like ngx_http.c), |
79 they would init its modules and ngx_listening_sockets */ | 90 they would init its modules and ngx_listening_sockets */ |