Пример #1
0
static char *
lxl_core_module_init_conf(lxl_cycle_t *cycle, void *conf)
{
	lxl_core_conf_t *ccf = conf;

	lxl_conf_init_value(ccf->daemon, 1);
	lxl_conf_init_value(ccf->worker_process, 1);

	return NULL;
}
static char *	
lxl_dns_core_init_main_conf(lxl_conf_t *cf, void *conf)
{
	lxl_dns_core_main_conf_t *cmcf = conf;

	lxl_conf_init_value(cmcf->tcp, 0);
	lxl_conf_init_uint_value(cmcf->zone_hash_bucket_size, 1000000);		/* 1m */
	/* named root file */
	
	return LXL_CONF_OK;
}
Пример #3
0
static char *
lxl_event_core_init_conf(lxl_cycle_t *cycle, void *conf)
{
	lxl_event_conf_t *ecf = (lxl_event_conf_t *) conf;

	lxl_uint_t i;
	lxl_module_t *module;
	lxl_event_module_t *event_module;

	module = NULL;

#if LXL_HAVE_EPOLL

		module = &lxl_epoll_module;

#endif 

#if LXL_HAVE_KQUEUE

		/* module = &lxl_kqueue_module */

#endif

	if (module == NULL) {
		for (i = 0; lxl_modules[i]; ++i) {
			if (lxl_modules[i]->type != LXL_EVENT_MODULE) {
				continue;
			}

			event_module = lxl_modules[i]->ctx;
			if (event_module->name->len == event_core_name.len 
					&& memcmp(event_module->name->data, event_core_name.data, event_core_name.len) == 0) {
				continue;
			}

			module = lxl_modules[i];
			break;
		}
	}

	if (module == NULL) {
		lxl_log_error(LXL_LOG_EMERG, 0, "no events module found");
		return LXL_CONF_ERROR;
	}

	lxl_conf_init_uint_value(ecf->connections, DEFAULT_CONNECTIONS);
	cycle->connection_n = ecf->connections;
	lxl_conf_init_uint_value(ecf->use, module->ctx_index);
	lxl_conf_init_value(ecf->accept_mutex, 0);
	
	return LXL_CONF_OK;
}