extern ngx_module_t ngx_select_module;
+static char *ngx_event_init_conf(ngx_cycle_t *cycle, void *conf);
static ngx_int_t ngx_event_module_init(ngx_cycle_t *cycle);
static ngx_int_t ngx_event_process_init(ngx_cycle_t *cycle);
static char *ngx_events_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
static char *ngx_event_debug_connection(ngx_conf_t *cf, ngx_command_t *cmd,
void *conf);
-static void *ngx_event_create_conf(ngx_cycle_t *cycle);
-static char *ngx_event_init_conf(ngx_cycle_t *cycle, void *conf);
+static void *ngx_event_core_create_conf(ngx_cycle_t *cycle);
+static char *ngx_event_core_init_conf(ngx_cycle_t *cycle, void *conf);
static ngx_uint_t ngx_timer_resolution;
static ngx_core_module_t ngx_events_module_ctx = {
ngx_string("events"),
NULL,
- NULL
+ ngx_event_init_conf
};
ngx_event_module_t ngx_event_core_module_ctx = {
&event_core_name,
- ngx_event_create_conf, /* create configuration */
- ngx_event_init_conf, /* init configuration */
+ ngx_event_core_create_conf, /* create configuration */
+ ngx_event_core_init_conf, /* init configuration */
{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
};
}
+static char *
+ngx_event_init_conf(ngx_cycle_t *cycle, void *conf)
+{
+ if (ngx_get_conf(cycle->conf_ctx, ngx_events_module) == NULL) {
+ ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
+ "no \"events\" section in configuration");
+ return NGX_CONF_ERROR;
+ }
+
+ return NGX_CONF_OK;
+}
+
+
static ngx_int_t
ngx_event_module_init(ngx_cycle_t *cycle)
{
ngx_event_conf_t *ecf;
cf = ngx_get_conf(cycle->conf_ctx, ngx_events_module);
-
- if (cf == NULL) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
- "no \"events\" section in configuration");
- return NGX_ERROR;
- }
-
ecf = (*cf)[ngx_event_core_module.ctx_index];
if (!ngx_test_config && ngx_process <= NGX_PROCESS_MASTER) {
static void *
-ngx_event_create_conf(ngx_cycle_t *cycle)
+ngx_event_core_create_conf(ngx_cycle_t *cycle)
{
ngx_event_conf_t *ecf;
static char *
-ngx_event_init_conf(ngx_cycle_t *cycle, void *conf)
+ngx_event_core_init_conf(ngx_cycle_t *cycle, void *conf)
{
ngx_event_conf_t *ecf = conf;