Mercurial > hg > nginx
diff src/event/ngx_event.c @ 112:da763a85be66
nginx-0.0.1-2003-07-04-10:03:52 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 04 Jul 2003 06:03:52 +0000 |
parents | a9bc21d63fe4 |
children | d7f606e25b99 |
line wrap: on
line diff
--- a/src/event/ngx_event.c +++ b/src/event/ngx_event.c @@ -108,12 +108,38 @@ ngx_module_t ngx_event_core_module = { &ngx_event_core_module_ctx, /* module context */ ngx_event_core_commands, /* module directives */ NGX_EVENT_MODULE, /* module type */ - NULL /* init module */ + ngx_event_init_module, /* init module */ + ngx_event_commit, /* commit module */ + ngx_event_rollback, /* rollback module */ + ngx_event_init_child /* init child */ }; -int ngx_pre_thread(ngx_array_t *ls, ngx_pool_t *pool, ngx_log_t *log) +static int ngx_event_init_module(ngx_cycle_t *cycle, ngx_log_t *log) +{ + if (cycle->one_process) { + return ngx_event_init(cycle, log); + } + + return NGX_OK; +} + + +static int ngx_event_init_child(ngx_cycle_t *cycle) +{ + if (!cycle->one_process) { + if (ngx_event_init(cycle, cycle->log) == NGX_ERROR) { + return NGX_ERROR; + } + ngx_event_commit(cycle, cycle->log); + } + + return NGX_OK; +} + + +static int ngx_event_init(ngx_cycle_t *cycle, ngx_log_t *log) { int m, i, fd; ngx_event_t *rev, *wev; @@ -125,7 +151,7 @@ int ngx_pre_thread(ngx_array_t *ls, ngx_ ngx_iocp_conf_t *iocpcf; #endif - ecf = ngx_event_get_conf(ngx_event_core_module); + ecf = ngx_event_get_conf(cycle->conf_ctx, ngx_event_core_module); ngx_log_debug(log, "CONN: %d" _ ecf->connections); ngx_log_debug(log, "TYPE: %d" _ ecf->use); @@ -144,6 +170,9 @@ ngx_log_debug(log, "TYPE: %d" _ ecf->use } } + if (ecf->connections) { + } + ngx_test_null(ngx_connections, ngx_alloc(sizeof(ngx_connection_t) * ecf->connections, log), NGX_ERROR); @@ -235,6 +264,16 @@ ngx_log_debug(log, "TYPE: %d" _ ecf->use } +static void ngx_event_commit(ngx_cycle_t *cycle, ngx_log_t *log) +{ +} + + +static void ngx_event_rollback(ngx_cycle_t *cycle, ngx_log_t *log) +{ +} + + void ngx_worker(ngx_cycle_t *cycle) { for ( ;; ) {