diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-01-09 05:36:00 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-01-09 05:36:00 +0000 |
commit | 4e9393a0548d783cd6f50d1fcd003c85a24b2b16 (patch) | |
tree | 300b40876e7ea6c103b7a080e380cdaaaf31260e /src/core/nginx.c | |
parent | c1817846d29be14903e40a0551f706ff50e09dcf (diff) | |
download | nginx-4e9393a0548d783cd6f50d1fcd003c85a24b2b16.tar.gz nginx-4e9393a0548d783cd6f50d1fcd003c85a24b2b16.zip |
nginx-0.0.1-2003-01-09-08:36:00 import
Diffstat (limited to 'src/core/nginx.c')
-rw-r--r-- | src/core/nginx.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c index 0a0233f49..ead14530a 100644 --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -36,7 +36,7 @@ ngx_pool_t *ngx_pool; int ngx_connection_counter; -ngx_array_t *ngx_listening_sockets; +ngx_array_t ngx_listening_sockets; int main(int argc, char *const *argv) @@ -56,9 +56,9 @@ int main(int argc, char *const *argv) ngx_init_sockets(&ngx_log); - /* TODO: read config */ + ngx_init_array(ngx_listening_sockets, ngx_pool, 10, sizeof(ngx_listen_t), + 1); -#if 1 ngx_memzero(&conf, sizeof(ngx_conf_t)); ngx_test_null(conf.args, ngx_create_array(ngx_pool, 10, sizeof(ngx_str_t)), 1); @@ -69,16 +69,16 @@ int main(int argc, char *const *argv) conf_file.len = sizeof("nginx.conf") - 1; conf_file.data = "nginx.conf"; - ngx_conf_parse(&conf, &conf_file); -#endif - - ngx_test_null(ngx_listening_sockets, - ngx_create_array(ngx_pool, 10, sizeof(ngx_listen_t)), 1); + if (ngx_conf_parse(&conf, &conf_file) != NGX_CONF_OK) { + exit(1); + } +#if 0 /* STUB */ /* TODO: init chain of global modules (like ngx_http.c), they would init its modules and ngx_listening_sockets */ ngx_http_init(ngx_pool, &ngx_log); +#endif ngx_open_listening_sockets(&ngx_log); @@ -86,7 +86,7 @@ int main(int argc, char *const *argv) /* TODO: fork */ - ngx_pre_thread(ngx_listening_sockets, ngx_pool, &ngx_log); + ngx_pre_thread(&ngx_listening_sockets, ngx_pool, &ngx_log); /* TODO: threads */ @@ -125,10 +125,10 @@ static void ngx_open_listening_sockets(ngx_log_t *log) failed = 0; /* for each listening socket */ - ls = (ngx_listen_t *) ngx_listening_sockets->elts; - for (i = 0; i < ngx_listening_sockets->nelts; i++) { + ls = (ngx_listen_t *) ngx_listening_sockets.elts; + for (i = 0; i < ngx_listening_sockets.nelts; i++) { - if (ls[i].done) + if (ls[i].bound) continue; if (ls[i].inherited) { @@ -137,7 +137,7 @@ static void ngx_open_listening_sockets(ngx_log_t *log) /* TODO: nonblocking */ /* TODO: deferred accept */ - ls[i].done = 1; + ls[i].bound = 1; continue; } @@ -194,7 +194,7 @@ static void ngx_open_listening_sockets(ngx_log_t *log) /* TODO: deferred accept */ ls[i].fd = s; - ls[i].done = 1; + ls[i].bound = 1; } if (!failed) |