Exemplo n.º 1
0
/**
 * Close node stability caching.
 */
G_GNUC_COLD void
stable_close(void)
{
    dbstore_close(db_lifedata, settings_dht_db_dir(), db_stable_base);
    db_lifedata = NULL;
    cq_periodic_remove(&stable_sync_ev);
    cq_periodic_remove(&stable_prune_ev);
}
Exemplo n.º 2
0
/**
 * Close GUID management.
 */
G_GNUC_COLD void
guid_close(void)
{
	dbstore_close(db_guid, settings_gnet_db_dir(), db_guid_base);
	db_guid = NULL;
	cq_periodic_remove(&guid_prune_ev);
	cq_periodic_remove(&guid_sync_ev);
}
Exemplo n.º 3
0
/**
 * Shutdown the DHT publisher.
 */
void G_COLD
publisher_close(void)
{
	/*
	 * Purge data we no longer know about from the persisted DB.
	 */

	dbmw_foreach_remove(db_pubdata, publisher_remove_orphan, NULL);

	/*
	 * Final cleanup.
	 */

	hikset_foreach(publisher_sha1, free_entry, NULL);
	hikset_free_null(&publisher_sha1);

	dbstore_close(db_pubdata, settings_dht_db_dir(), db_pubdata_base);
	db_pubdata = NULL;

	cq_free_null(&publish_cq);
}
Exemplo n.º 4
0
/**
 * Close local key management.
 */
G_GNUC_COLD void
keys_close(void)
{
	values_close();

	dbstore_close(db_keydata, settings_dht_db_dir(), db_keybase);
	db_keydata = NULL;

	if (keys) {
		hikset_foreach(keys, keys_free_kv, NULL);
		hikset_free_null(&keys);
	}

	kuid_atom_free_null(&kball.furthest);
	kuid_atom_free_null(&kball.closest);

	gnet_stats_set_general(GNR_DHT_KEYS_HELD, 0);
	gnet_stats_set_general(GNR_DHT_CACHED_KEYS_HELD, 0);

	cq_cancel(&kball_ev);
	cq_periodic_remove(&keys_periodic_ev);
	cq_periodic_remove(&keys_sync_ev);
}