Mercurial > hg > nginx
diff src/event/ngx_event.c @ 92:19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 20 May 2003 15:37:55 +0000 |
parents | 637625a2acdb |
children | 738fe44c70d5 |
line wrap: on
line diff
--- a/src/event/ngx_event.c +++ b/src/event/ngx_event.c @@ -1,31 +1,25 @@ #include <ngx_config.h> #include <ngx_core.h> -#include <ngx_types.h> -#include <ngx_string.h> -#include <ngx_log.h> -#include <ngx_alloc.h> -#include <ngx_array.h> #include <ngx_listen.h> #include <ngx_connection.h> #include <ngx_event.h> -#include <ngx_conf_file.h> + + +#define DEF_CONNECTIONS 1024 + extern ngx_event_module_t ngx_select_module_ctx; -#if (HAVE_POLL) -#include <ngx_poll_module.h> -#endif - -#if (HAVE_DEVPOLL) -#include <ngx_devpoll_module.h> -#endif - #if (HAVE_KQUEUE) extern ngx_event_module_t ngx_kqueue_module_ctx; #include <ngx_kqueue_module.h> #endif +#if (HAVE_DEVPOLL) +extern ngx_event_module_t ngx_devpoll_module_ctx; +#endif + #if (HAVE_AIO) #include <ngx_aio_module.h> #endif @@ -259,7 +253,6 @@ static char *ngx_events_block(ngx_conf_t char *rv; void ***ctx; ngx_conf_t pcf; - ngx_event_conf_t *ecf; ngx_event_module_t *module; /* count the number of the event modules and set up their indices */ @@ -364,6 +357,7 @@ static void *ngx_event_create_conf(ngx_p NGX_CONF_ERROR); ecf->connections = NGX_CONF_UNSET; + ecf->timer_queues = NGX_CONF_UNSET; ecf->type = NGX_CONF_UNSET; return ecf; @@ -376,13 +370,27 @@ static char *ngx_event_init_conf(ngx_poo #if (HAVE_KQUEUE) - ngx_conf_init_value(ecf->connections, 1024); +#if 0 + if (ecf->connections != NGX_CONF_UNSET) { + ecf->connections = (ngx_max_connections < DEF_CONNECTIONS) ? + ngx_max_connections : DEF_CONNECTIONS; + + } else if (ecf->connections > ngx_max_connections) { + } +#endif + + ngx_conf_init_value(ecf->connections, DEF_CONNECTIONS); ngx_conf_init_value(ecf->type, ngx_kqueue_module_ctx.index); +#elif (HAVE_DEVPOLL) + + ngx_conf_init_value(ecf->connections, DEF_CONNECTIONS); + ngx_conf_init_value(ecf->type, ngx_devpoll_module_ctx.index); + #else /* HAVE_SELECT */ ngx_conf_init_value(ecf->connections, - FD_SETSIZE < 1024 ? FD_SETSIZE : 1024); + FD_SETSIZE < DEF_CONNECTIONS ? FD_SETSIZE : DEF_CONNECTIONS); ngx_conf_init_value(ecf->type, ngx_select_module_ctx.index);