示例#1
0
文件: hgd-admin.c 项目: Eeketh/hgd
int
hgd_read_config(char **config_locations)
{
#ifdef HAVE_LIBCONFIG
	/*
	 * config_lookup_int64 is used because lib_config changed
	 * config_lookup_int from returning a long int, to a int, and debian
	 * still uses the old version.
	 */
	config_t		 cfg, *cf;
	int			 dont_fork = dont_fork;

	cf = &cfg;

	if (hgd_load_config(cf, config_locations) == HGD_FAIL) {
		return (HGD_OK);
	}

	hgd_cfg_statepath(cf, &state_path);
	hgd_cfg_debug(cf, "admin", &hgd_debug);

	config_destroy(cf);
#endif
	return (HGD_OK);
}
示例#2
0
文件: hgd-playd.c 项目: zandeez/hgd
int
hgd_read_config(char **config_locations)
{
#ifdef HAVE_LIBCONFIG
	/*
	 * config_lookup_int64 is used because lib_config changed
	 * config_lookup_int from returning a long int, to a int, and debian
	 * still uses the old version.
	 */
	config_t		 cfg, *cf;

	cf = &cfg;

	if (hgd_load_config(cf, config_locations) == HGD_FAIL) {
		return (HGD_OK);
	}

	hgd_cfg_daemonise(cf, "playd", &background);
	hgd_cfg_statepath(cf, &state_path);
	hgd_cfg_playd_purgefs(cf, &purge_finished_fs);
#ifdef HAVE_PYTHON
	hgd_cfg_pluginpath(cf, &hgd_py_plugin_dir);
#endif
	hgd_cfg_playd_purgedb(cf, &purge_finished_db);
	hgd_cfg_debug(cf, "playd", &hgd_debug);

	config_destroy(cf);
#endif
	return (HGD_OK);
}
示例#3
0
int
hgd_read_config(char **config_locations)
{
#ifdef HAVE_LIBCONFIG
	/*
	 * config_lookup_int64 is used because lib_config changed
	 * config_lookup_int from returning a long int, to a int, and debian
	 * still uses the old version.
	 * See hgd-playd.c for how to remove the stat when deb get into gear
	 */
	config_t		 cfg, *cf;

	cf = &cfg;

	if (hgd_load_config(cf, config_locations) == HGD_FAIL) {
		return (HGD_OK);
	}

	hgd_cfg_daemonise(cf, "netd", &background);
	hgd_cfg_netd_rdns(cf, &lookup_client_dns); 
	hgd_cfg_statepath(cf, &state_path);
	hgd_cfg_crypto(cf, "netd", &crypto_pref);	
	hgd_cfg_fork(cf, "netd", &single_client);
	hgd_cfg_netd_flood_limit(cf, &flood_limit);
	hgd_cf_netd_ssl_privkey(cf, &ssl_key_path);
	hgd_cfg_netd_votesound(cf, &req_votes);
	hgd_cfg_netd_port(cf, &port);
	hgd_cfg_netd_max_filesize(cf, &max_upload_size);
	hgd_cfg_netd_sslcert(cf, &ssl_cert_path);
	hgd_cfg_debug(cf, "netd", &hgd_debug);
	hgd_cfg_netd_voteoff_sound(cf, &vote_sound);

	/* we can destory config here because we copy all heap alloc'd stuff */
	config_destroy(cf);
#endif

	return (HGD_OK);
}