diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2003-07-07 06:11:50 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2003-07-07 06:11:50 +0000 |
| commit | 9d639520aa95f0ff3882ea348d4347f69cbae493 (patch) | |
| tree | a163ada230b77745dc9117df4a2a5dce756115cc /src/event/modules | |
| parent | 340b03b201c77f394cc70fda4d960ad6c3b68905 (diff) | |
| download | nginx-9d639520aa95f0ff3882ea348d4347f69cbae493.tar.gz nginx-9d639520aa95f0ff3882ea348d4347f69cbae493.tar.bz2 | |
nginx-0.0.1-2003-07-07-10:11:50 import
Diffstat (limited to 'src/event/modules')
| -rw-r--r-- | src/event/modules/ngx_aio_module.c | 18 | ||||
| -rw-r--r-- | src/event/modules/ngx_devpoll_module.c | 18 | ||||
| -rw-r--r-- | src/event/modules/ngx_iocp_module.c | 56 | ||||
| -rw-r--r-- | src/event/modules/ngx_kqueue_module.c | 29 | ||||
| -rw-r--r-- | src/event/modules/ngx_poll_module.c | 124 | ||||
| -rw-r--r-- | src/event/modules/ngx_select_module.c | 94 |
6 files changed, 233 insertions, 106 deletions
diff --git a/src/event/modules/ngx_aio_module.c b/src/event/modules/ngx_aio_module.c index cc48926de..cdfb1b01f 100644 --- a/src/event/modules/ngx_aio_module.c +++ b/src/event/modules/ngx_aio_module.c @@ -9,8 +9,8 @@ #endif -static int ngx_aio_init(ngx_log_t *log); -static void ngx_aio_done(ngx_log_t *log); +static int ngx_aio_init(ngx_cycle_t *cycle); +static void ngx_aio_done(ngx_cycle_t *cycle); static int ngx_aio_add_event(ngx_event_t *ev, int event, u_int flags); static int ngx_aio_del_event(ngx_event_t *ev, int event, u_int flags); static int ngx_aio_del_connection(ngx_connection_t *c); @@ -52,31 +52,33 @@ ngx_module_t ngx_aio_module = { &ngx_aio_module_ctx, /* module context */ NULL, /* module directives */ NGX_EVENT_MODULE, /* module type */ - NULL /* init module */ + NULL, /* init module */ + NULL /* init child */ }; #if (HAVE_KQUEUE) -static int ngx_aio_init(ngx_log_t *log) +static int ngx_aio_init(ngx_cycle_t *cycle) { - if (ngx_kqueue_module_ctx.actions.init(log) == NGX_ERROR) { + if (ngx_kqueue_module_ctx.actions.init(cycle) == NGX_ERROR) { return NGX_ERROR; } + ngx_io = ngx_os_aio; + ngx_event_flags = NGX_HAVE_AIO_EVENT|NGX_USE_AIO_EVENT; ngx_event_actions = ngx_aio_module_ctx.actions; - ngx_io = ngx_os_aio; return NGX_OK; } -static void ngx_aio_done(ngx_log_t *log) +static void ngx_aio_done(ngx_cycle_t *cycle) { - ngx_kqueue_module_ctx.actions.done(log); + ngx_kqueue_module_ctx.actions.done(cycle); } diff --git a/src/event/modules/ngx_devpoll_module.c b/src/event/modules/ngx_devpoll_module.c index 47313e949..05aed62fd 100644 --- a/src/event/modules/ngx_devpoll_module.c +++ b/src/event/modules/ngx_devpoll_module.c @@ -317,8 +317,9 @@ int ngx_devpoll_process_events(ngx_log_t *log) events = ioctl(dp, DP_POLL, &dvp); if (events == -1) { - ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, "ioctl(DP_POLL) failed"); - return NGX_ERROR; + err = ngx_errno; + } else { + err = 0; } nchanges = 0; @@ -326,6 +327,10 @@ int ngx_devpoll_process_events(ngx_log_t *log) if ((int) timer != INFTIM) { gettimeofday(&tv, NULL); delta = tv.tv_sec * 1000 + tv.tv_usec / 1000 - delta; + +#if (NGX_DEBUG_EVENT) + ngx_log_debug(log, "devpoll timer: %d, delta: %d" _ timer _ delta); +#endif ngx_event_expire_timers(delta); } else { @@ -334,11 +339,16 @@ int ngx_devpoll_process_events(ngx_log_t *log) "ioctl(DP_POLL) returns no events without timeout"); return NGX_ERROR; } - } #if (NGX_DEBUG_EVENT) - ngx_log_debug(log, "devpoll timer: %d, delta: %d" _ timer _ delta); + ngx_log_debug(log, "devpoll timer: %d, delta: %d" _ timer _ delta); #endif + } + + if (err) { + ngx_log_error(NGX_LOG_ALERT, log, err, "ioctl(DP_POLL) failed"); + return NGX_ERROR; + } for (i = 0; i < events; i++) { diff --git a/src/event/modules/ngx_iocp_module.c b/src/event/modules/ngx_iocp_module.c index 004a3da38..2f31eb6fb 100644 --- a/src/event/modules/ngx_iocp_module.c +++ b/src/event/modules/ngx_iocp_module.c @@ -10,13 +10,13 @@ #include <ngx_iocp_module.h> -static int ngx_iocp_init(ngx_log_t *log); -static void ngx_iocp_done(ngx_log_t *log); +static int ngx_iocp_init(ngx_cycle_t *cycle); +static void ngx_iocp_done(ngx_cycle_t *cycle); static int ngx_iocp_add_event(ngx_event_t *ev, int event, u_int key); static int ngx_iocp_del_connection(ngx_connection_t *c); static int ngx_iocp_process_events(ngx_log_t *log); -static void *ngx_iocp_create_conf(ngx_pool_t *pool); -static char *ngx_iocp_init_conf(ngx_pool_t *pool, void *conf); +static void *ngx_iocp_create_conf(ngx_cycle_t *cycle); +static char *ngx_iocp_init_conf(ngx_cycle_t *cycle, void *conf); static ngx_str_t iocp_name = ngx_string("iocp"); @@ -72,31 +72,37 @@ ngx_module_t ngx_iocp_module = { &ngx_iocp_module_ctx, /* module context */ ngx_iocp_commands, /* module directives */ NGX_EVENT_MODULE, /* module type */ - NULL /* init module */ + NULL, /* init module */ + NULL /* init child */ }; static HANDLE iocp; -static int ngx_iocp_init(ngx_log_t *log) +static int ngx_iocp_init(ngx_cycle_t *cycle) { ngx_iocp_conf_t *cf; - cf = ngx_event_get_conf(ngx_iocp_module); + cf = ngx_event_get_conf(cycle->conf_ctx, ngx_iocp_module); - iocp = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, cf->threads); + if (iocp == NULL) { + iocp = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, + cf->threads); + } if (iocp == NULL) { - ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, + ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, "CreateIoCompletionPort() failed"); return NGX_ERROR; } - if (ngx_event_timer_init(log) == NGX_ERROR) { + if (ngx_event_timer_init(cycle) == NGX_ERROR) { return NGX_ERROR; } + ngx_io = ngx_os_io; + ngx_event_actions = ngx_iocp_module_ctx.actions; ngx_event_flags = NGX_HAVE_AIO_EVENT|NGX_HAVE_IOCP_EVENT; @@ -105,14 +111,16 @@ static int ngx_iocp_init(ngx_log_t *log) } -static void ngx_iocp_done(ngx_log_t *log) +static void ngx_iocp_done(ngx_cycle_t *cycle) { if (CloseHandle(iocp) == -1) { - ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, - "iocp CloseHandle() failed"); + ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, + "iocp CloseHandle() failed"); } - ngx_event_timer_done(log); + iocp = NULL; + + ngx_event_timer_done(cycle); } @@ -177,7 +185,16 @@ static int ngx_iocp_process_events(ngx_log_t *log) if (rc == 0) { err = ngx_errno; + } else { + err = 0; + } + + if (timer != INFINITE) { + delta = ngx_msec() - delta; + ngx_event_expire_timers(delta); + } + if (err) { if (ovlp == NULL) { if (err != WAIT_TIMEOUT) { ngx_log_error(NGX_LOG_ALERT, log, err, @@ -191,11 +208,6 @@ static int ngx_iocp_process_events(ngx_log_t *log) } } - if (timer != INFINITE) { - delta = ngx_msec() - delta; - ngx_event_expire_timers(delta); - } - if (ovlp) { ev = ovlp->event; @@ -224,11 +236,11 @@ ngx_log_debug(log, "iocp ev handler: %08x" _ ev->event_handler); } -static void *ngx_iocp_create_conf(ngx_pool_t *pool) +static void *ngx_iocp_create_conf(ngx_cycle_t *cycle) { ngx_iocp_conf_t *cf; - ngx_test_null(cf, ngx_palloc(pool, sizeof(ngx_iocp_conf_t)), + ngx_test_null(cf, ngx_palloc(cycle->pool, sizeof(ngx_iocp_conf_t)), NGX_CONF_ERROR); cf->threads = NGX_CONF_UNSET; @@ -239,7 +251,7 @@ static void *ngx_iocp_create_conf(ngx_pool_t *pool) } -static char *ngx_iocp_init_conf(ngx_pool_t *pool, void *conf) +static char *ngx_iocp_init_conf(ngx_cycle_t *cycle, void *conf) { ngx_iocp_conf_t *cf = conf; diff --git a/src/event/modules/ngx_kqueue_module.c b/src/event/modules/ngx_kqueue_module.c index bdd1ff4c3..d0a9d2e48 100644 --- a/src/event/modules/ngx_kqueue_module.c +++ b/src/event/modules/ngx_kqueue_module.c @@ -23,8 +23,8 @@ static int ngx_kqueue_del_event(ngx_event_t *ev, int event, u_int flags); static int ngx_kqueue_set_event(ngx_event_t *ev, int filter, u_int flags); static int ngx_kqueue_process_events(ngx_log_t *log); -static void *ngx_kqueue_create_conf(ngx_pool_t *pool); -static char *ngx_kqueue_init_conf(ngx_pool_t *pool, void *conf); +static void *ngx_kqueue_create_conf(ngx_cycle_t *cycle); +static char *ngx_kqueue_init_conf(ngx_cycle_t *cycle, void *conf); int ngx_kqueue = -1; @@ -311,6 +311,7 @@ static int ngx_kqueue_set_event(ngx_event_t *ev, int filter, u_int flags) static int ngx_kqueue_process_events(ngx_log_t *log) { int events, instance, i; + ngx_err_t err; ngx_msec_t timer, delta; ngx_event_t *ev; struct timeval tv; @@ -338,8 +339,9 @@ static int ngx_kqueue_process_events(ngx_log_t *log) events = kevent(ngx_kqueue, change_list, nchanges, event_list, nevents, tp); if (events == -1) { - ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, "kevent() failed"); - return NGX_ERROR; + err = ngx_errno; + } else { + err = 0; } nchanges = 0; @@ -348,6 +350,10 @@ static int ngx_kqueue_process_events(ngx_log_t *log) gettimeofday(&tv, NULL); delta = tv.tv_sec * 1000 + tv.tv_usec / 1000 - delta; +#if (NGX_DEBUG_EVENT) + ngx_log_debug(log, "kevent timer: %d, delta: %d" _ timer _ delta); +#endif + /* The expired timers must be handled before a processing of the events because the new timers can be added during a processing */ @@ -359,11 +365,16 @@ static int ngx_kqueue_process_events(ngx_log_t *log) "kevent() returned no events without timeout"); return NGX_ERROR; } - } #if (NGX_DEBUG_EVENT) - ngx_log_debug(log, "kevent timer: %d, delta: %d" _ timer _ delta); + ngx_log_debug(log, "kevent timer: %d, delta: %d" _ timer _ delta); #endif + } + + if (err) { + ngx_log_error(NGX_LOG_ALERT, log, err, "kevent() failed"); + return NGX_ERROR; + } for (i = 0; i < events; i++) { @@ -439,11 +450,11 @@ static int ngx_kqueue_process_events(ngx_log_t *log) } -static void *ngx_kqueue_create_conf(ngx_pool_t *pool) +static void *ngx_kqueue_create_conf(ngx_cycle_t *cycle) { ngx_kqueue_conf_t *kcf; - ngx_test_null(kcf, ngx_palloc(pool, sizeof(ngx_kqueue_conf_t)), + ngx_test_null(kcf, ngx_palloc(cycle->pool, sizeof(ngx_kqueue_conf_t)), NGX_CONF_ERROR); kcf->changes = NGX_CONF_UNSET; @@ -453,7 +464,7 @@ static void *ngx_kqueue_create_conf(ngx_pool_t *pool) } -static char *ngx_kqueue_init_conf(ngx_pool_t *pool, void *conf) +static char *ngx_kqueue_init_conf(ngx_cycle_t *cycle, void *conf) { ngx_kqueue_conf_t *kcf = conf; diff --git a/src/event/modules/ngx_poll_module.c b/src/event/modules/ngx_poll_module.c index b03ed1745..71ac7f2ca 100644 --- a/src/event/modules/ngx_poll_module.c +++ b/src/event/modules/ngx_poll_module.c @@ -9,8 +9,8 @@ #include <ngx_event.h> -static int ngx_poll_init(ngx_log_t *log); -static void ngx_poll_done(ngx_log_t *log); +static int ngx_poll_init(ngx_cycle_t *cycle); +static void ngx_poll_done(ngx_cycle_t *cycle); static int ngx_poll_add_event(ngx_event_t *ev, int event, u_int flags); static int ngx_poll_del_event(ngx_event_t *ev, int event, u_int flags); static int ngx_poll_process_events(ngx_log_t *log); @@ -49,35 +49,64 @@ ngx_module_t ngx_poll_module = { &ngx_poll_module_ctx, /* module context */ NULL, /* module directives */ NGX_EVENT_MODULE, /* module type */ - NULL /* init module */ + NULL, /* init module */ + NULL /* init child */ }; -static int ngx_poll_init(ngx_log_t *log) +static int ngx_poll_init(ngx_cycle_t *cycle) { - ngx_event_conf_t *ecf; + struct pollfd *list; + ngx_event_t **index; - ecf = ngx_event_get_conf(ngx_event_core_module); + if (event_list == NULL) { + nevents = 0; + } + + if (cycle->old_cycle == NULL + || cycle->old_cycle->connection_n < cycle->connection_n) + { + ngx_test_null(list, + ngx_alloc(sizeof(struct pollfd) * cycle->connection_n, + cycle->log), + NGX_ERROR); + + if (event_list) { + ngx_memcpy(list, event_list, sizeof(ngx_event_t *) * nevents); + ngx_free(event_list); + } - ngx_test_null(event_list, - ngx_alloc(sizeof(struct pollfd) * ecf->connections, log), - NGX_ERROR); + event_list = list; + + ngx_test_null(index, + ngx_alloc(sizeof(ngx_event_t *) * cycle->connection_n, + cycle->log), + NGX_ERROR); + + if (event_index) { + ngx_memcpy(index, event_index, sizeof(ngx_event_t *) * nevents); + ngx_free(event_index); + } - ngx_test_null(event_index, - ngx_alloc(sizeof(ngx_event_t *) * ecf->connections, log), - NGX_ERROR); + event_index = index; - ngx_test_null(ready_index, - ngx_alloc(sizeof(ngx_event_t *) * 2 * ecf->connections, log), - NGX_ERROR); + if (ready_index) { + ngx_free(ready_index); + } - nevents = 0; + ngx_test_null(ready_index, + ngx_alloc(sizeof(ngx_event_t *) * 2 * cycle->connection_n, + cycle->log), + NGX_ERROR); + } - if (ngx_event_timer_init(log) == NGX_ERROR) { + if (ngx_event_timer_init(cycle) == NGX_ERROR) { return NGX_ERROR; } + ngx_io = ngx_os_io; + ngx_event_actions = ngx_poll_module_ctx.actions; ngx_event_flags = NGX_HAVE_LEVEL_EVENT @@ -88,13 +117,15 @@ static int ngx_poll_init(ngx_log_t *log) } -static void ngx_poll_done(ngx_log_t *log) +static void ngx_poll_done(ngx_cycle_t *cycle) { - ngx_event_timer_done(log); + ngx_event_timer_done(cycle); ngx_free(event_list); ngx_free(event_index); ngx_free(ready_index); + + event_list = NULL; } @@ -191,12 +222,13 @@ static int ngx_poll_del_event(ngx_event_t *ev, int event, u_int flags) static int ngx_poll_process_events(ngx_log_t *log) { - int ready, found; - u_int i, nready; - ngx_msec_t timer, delta; - ngx_err_t err; - ngx_event_t *ev; - ngx_connection_t *c; + int ready, found; + u_int i, nready; + ngx_msec_t timer, delta; + ngx_err_t err; + ngx_cycle_t **cycle; + ngx_event_t *ev; + ngx_connection_t *c; timer = ngx_event_find_timer(); @@ -217,15 +249,22 @@ static int ngx_poll_process_events(ngx_log_t *log) ngx_log_debug(log, "poll timer: %d" _ timer); #endif - if ((ready = poll(event_list, nevents, timer)) == -1) { - ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, "poll() failed"); - return NGX_ERROR; + ready = poll(event_list, nevents, timer); + + if (ready == -1) { + err = ngx_errno; + } else { + err = 0; } ngx_log_debug(log, "poll ready %d" _ ready); if ((int) timer != INFTIM) { delta = ngx_msec() - delta; + +#if (NGX_DEBUG_EVENT) + ngx_log_debug(log, "poll timer: %d, delta: %d" _ timer _ delta); +#endif ngx_event_expire_timers(delta); } else { @@ -234,16 +273,39 @@ static int ngx_poll_process_events(ngx_log_t *log) "poll() returns no events without timeout"); return NGX_ERROR; } - } #if (NGX_DEBUG_EVENT) - ngx_log_debug(log, "poll timer: %d, delta: %d" _ timer _ delta); + ngx_log_debug(log, "poll timer: %d, delta: %d" _ timer _ delta); #endif + } + + if (err) { + ngx_log_error(NGX_LOG_ALERT, log, err, "poll() failed"); + return NGX_ERROR; + } nready = 0; for (i = 0; i < nevents && ready; i++) { - c = &ngx_connections[event_list[i].fd]; + c = &ngx_cycle->connections[event_list[i].fd]; + + if (c->fd == -1) { + cycle = ngx_old_cycles.elts; + for (i = 0; i < ngx_old_cycles.nelts; i++) { + if (cycle[i] == NULL) { + continue; + } + c = &cycle[i]->connections[event_list[i].fd]; + if (c->fd != -1) { + break; + } + } + } + + if (c->fd == -1) { + ngx_log_error(NGX_LOG_ALERT, log, 0, "unkonwn cycle"); + exit(1); + } #if (NGX_DEBUG_EVENT) ngx_log_debug(log, "poll: fd:%d, ev:%d, rev:%d" _ diff --git a/src/event/modules/ngx_select_module.c b/src/event/modules/ngx_select_module.c index a55be3034..3bf42efcb 100644 --- a/src/event/modules/ngx_select_module.c +++ b/src/event/modules/ngx_select_module.c @@ -9,13 +9,13 @@ #include <ngx_event.h> -static int ngx_select_init(ngx_log_t *log); -static void ngx_select_done(ngx_log_t *log); +static int ngx_select_init(ngx_cycle_t *cycle); +static void ngx_select_done(ngx_cycle_t *cycle); static int ngx_select_add_event(ngx_event_t *ev, int event, u_int flags); static int ngx_select_del_event(ngx_event_t *ev, int event, u_int flags); static int ngx_select_process_events(ngx_log_t *log); -static char *ngx_select_init_conf(ngx_pool_t *pool, void *conf); +static char *ngx_select_init_conf(ngx_cycle_t *cycle, void *conf); static fd_set master_read_fd_set; @@ -62,33 +62,50 @@ ngx_module_t ngx_select_module = { &ngx_select_module_ctx, /* module context */ NULL, /* module directives */ NGX_EVENT_MODULE, /* module type */ - NULL /* init module */ + NULL, /* init module */ + NULL /* init child */ }; -static int ngx_select_init(ngx_log_t *log) +static int ngx_select_init(ngx_cycle_t *cycle) { - ngx_event_conf_t *ecf; - - ecf = ngx_event_get_conf(ngx_event_core_module); - - FD_ZERO(&master_read_fd_set); - FD_ZERO(&master_write_fd_set); + ngx_event_t **index; - ngx_test_null(event_index, - ngx_alloc(sizeof(ngx_event_t *) * 2 * ecf->connections, log), - NGX_ERROR); + if (event_index == NULL) { + FD_ZERO(&master_read_fd_set); + FD_ZERO(&master_write_fd_set); + nevents = 0; + } - ngx_test_null(ready_index, - ngx_alloc(sizeof(ngx_event_t *) * 2 * ecf->connections, log), - NGX_ERROR); + if (cycle->old_cycle == NULL + || cycle->old_cycle->connection_n < cycle->connection_n) + { + ngx_test_null(index, + ngx_alloc(sizeof(ngx_event_t *) * 2 * cycle->connection_n, + cycle->log), + NGX_ERROR); + + if (event_index) { + ngx_memcpy(index, event_index, sizeof(ngx_event_t *) * nevents); + ngx_free(event_index); + } + event_index = index; - nevents = 0; + if (ready_index) { + ngx_free(ready_index); + } + ngx_test_null(ready_index, + ngx_alloc(sizeof(ngx_event_t *) * 2 * cycle->connection_n, + cycle->log), + NGX_ERROR); + } - if (ngx_event_timer_init(log) == NGX_ERROR) { + if (ngx_event_timer_init(cycle) == NGX_ERROR) { return NGX_ERROR; } + ngx_io = ngx_os_io; + ngx_event_actions = ngx_select_module_ctx.actions; ngx_event_flags = NGX_HAVE_LEVEL_EVENT @@ -105,12 +122,14 @@ static int ngx_select_init(ngx_log_t *log) } -static void ngx_select_done(ngx_log_t *log) +static void ngx_select_done(ngx_cycle_t *cycle) { - ngx_event_timer_done(log); + ngx_event_timer_done(cycle); ngx_free(event_index); ngx_free(ready_index); + + event_index = NULL; } @@ -229,6 +248,7 @@ static int ngx_select_process_events(ngx_log_t *log) { int ready, found; u_int i, nready; + ngx_err_t err; ngx_msec_t timer, delta; ngx_event_t *ev; ngx_connection_t *c; @@ -277,15 +297,15 @@ static int ngx_select_process_events(ngx_log_t *log) #endif #if (WIN32) - if ((ready = select(0, &work_read_fd_set, &work_write_fd_set, NULL, tp)) + ready = select(0, &work_read_fd_set, &work_write_fd_set, NULL, tp); #else - if ((ready = select(max_fd + 1, &work_read_fd_set, &work_write_fd_set, - NULL, tp)) + ready = select(max_fd + 1, &work_read_fd_set, &work_write_fd_set, NULL, tp); #endif - == -1) - { - ngx_log_error(NGX_LOG_ALERT, log, ngx_socket_errno, "select() failed"); - return NGX_ERROR; + + if (ready == -1) { + err = ngx_socket_errno; + } else { + err = 0; } #if (NGX_DEBUG_EVENT) @@ -295,6 +315,10 @@ static int ngx_select_process_events(ngx_log_t *log) if (timer) { /* TODO: Linux returns time in tv */ delta = ngx_msec() - delta; + +#if (NGX_DEBUG_EVENT) + ngx_log_debug(log, "select timer: %d, delta: %d" _ timer _ delta); +#endif ngx_event_expire_timers(delta); } else { @@ -303,11 +327,17 @@ static int ngx_select_process_events(ngx_log_t *log) "select() returns no events without timeout"); return NGX_ERROR; } - } #if (NGX_DEBUG_EVENT) - ngx_log_debug(log, "select timer: %d, delta: %d" _ timer _ delta); + ngx_log_debug(log, "select timer: %d, delta: %d" _ timer _ delta); #endif + ngx_event_expire_timers(delta); + } + + if (err) { + ngx_log_error(NGX_LOG_ALERT, log, err, "select() failed"); + return NGX_ERROR; + } nready = 0; @@ -372,11 +402,11 @@ static int ngx_select_process_events(ngx_log_t *log) } -static char *ngx_select_init_conf(ngx_pool_t *pool, void *conf) +static char *ngx_select_init_conf(ngx_cycle_t *cycle, void *conf) { ngx_event_conf_t *ecf; - ecf = ngx_event_get_conf(ngx_event_core_module); + ecf = ngx_event_get_conf(cycle->conf_ctx, ngx_event_core_module); /* the default FD_SETSIZE is 1024U in FreeBSD 5.x */ |
