Exemplo n.º 1
0
ret_t
cherokee_logger_ncsa_new (cherokee_logger_t         **logger,
			  cherokee_virtual_server_t  *vsrv,
			  cherokee_config_node_t     *config)
{
	ret_t ret;
	CHEROKEE_NEW_STRUCT (n, logger_ncsa);

	/* Init the base class object
	 */
	cherokee_logger_init_base (LOGGER(n), PLUGIN_INFO_PTR(ncsa), config);

	MODULE(n)->init         = (logger_func_init_t) cherokee_logger_ncsa_init;
	MODULE(n)->free         = (logger_func_free_t) cherokee_logger_ncsa_free;

	LOGGER(n)->flush        = (logger_func_flush_t) cherokee_logger_ncsa_flush;
	LOGGER(n)->reopen       = (logger_func_reopen_t) cherokee_logger_ncsa_reopen;
	LOGGER(n)->write_access = (logger_func_write_access_t) cherokee_logger_ncsa_write_access;

	n->writer_access = NULL;

	ret = cherokee_logger_ncsa_init_base (n, VSERVER(vsrv), config);
	if (unlikely(ret < ret_ok)) {
		cherokee_logger_free (LOGGER(n));
		return ret;
	}

	/* Return the object
	 */
	*logger = LOGGER(n);
	return ret_ok;
}
Exemplo n.º 2
0
ret_t
cherokee_vrule_configure (cherokee_vrule_t       *vrule,
			  cherokee_config_node_t *conf,
			  void                   *vsrv)
{
	ret_t ret;

	return_if_fail (vrule, ret_error);
	return_if_fail (vrule->configure, ret_error);

	ret = configure_base (vrule, conf);
	if (ret != ret_ok) return ret;

	/* Call the real method
	 */
	return vrule->configure (vrule, conf, VSERVER(vsrv));
}