#include "gnunet_dns_service.h"
#include "gnunet_dnsparser_lib.h"
#include "gnunet_dht_service.h"
+#include "gnunet_namecache_service.h"
#include "gnunet_namestore_service.h"
#include "gnunet_gns_service.h"
#include "gnunet_statistics_service.h"
*/
static struct GNUNET_NAMESTORE_Handle *namestore_handle;
+/**
+ * Our handle to the namecache service
+ */
+static struct GNUNET_NAMECACHE_Handle *namecache_handle;
+
/**
* Handle to iterate over our authoritative zone in namestore
*/
GNUNET_NAMESTORE_disconnect (namestore_handle);
namestore_handle = NULL;
}
+ if (NULL != namecache_handle)
+ {
+ GNUNET_NAMECACHE_disconnect (namecache_handle);
+ namecache_handle = NULL;
+ }
if (NULL != active_put)
{
GNUNET_DHT_put_cancel (active_put);
GNUNET_SCHEDULER_shutdown ();
return;
}
+ namecache_handle = GNUNET_NAMECACHE_connect (c);
+ if (NULL == namecache_handle)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Failed to connect to the namecache!\n"));
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
put_interval = INITIAL_PUT_INTERVAL;
zone_publish_time_window = DEFAULT_ZONE_PUBLISH_TIME_WINDOW;
return;
}
}
- GNS_resolver_init (namestore_handle, dht_handle,
+ GNS_resolver_init (namestore_handle,
+ namecache_handle,
+ dht_handle,
c,
max_parallel_bg_queries);
- GNS_shorten_init (namestore_handle, dht_handle);
+ GNS_shorten_init (namestore_handle,
+ namecache_handle,
+ dht_handle);
GNUNET_SERVER_disconnect_notify (server,
¬ify_client_disconnect,
NULL);