-fixes
[oweals/gnunet.git] / src / gns / gnunet-service-gns_resolver.h
index 5d9741bebce3b2ec8e7a21247250d3f93d3b27f8..8b0a05e5f984786a9294f91aabfad620c4b8d4ef 100644 (file)
@@ -11,6 +11,7 @@
 #define DHT_GNS_REPLICATION_LEVEL 5
 
 #define GNUNET_GNS_MAX_PARALLEL_LOOKUPS 500
+#define GNUNET_GNS_MAX_NS_TASKS 500
 
 /*
  * DLL to hold the authority chain
@@ -118,6 +119,19 @@ enum ResolutionStatus
  */
 struct ResolverHandle
 {
+
+  /* DLL */
+  struct ResolverHandle *next;
+
+  /* DLL */
+  struct ResolverHandle *prev;
+
+  /* Last record data found */
+  struct GNUNET_NAMESTORE_RecordData rd;
+
+  /* Number of last record data found */
+  unsigned int rd_count;
+
   /* The name to resolve */
   char name[MAX_DNS_NAME_LENGTH];
 
@@ -210,6 +224,11 @@ struct ResolverHandle
    */
   unsigned long long id;
 
+  /**
+   * Pending Namestore task
+   */
+  struct GNUNET_NAMESTORE_QueueEntry *namestore_task;
+
 };
 
 
@@ -271,6 +290,9 @@ struct GetNameAuthorityHandle
 {
   /* the name to look up authority for */
   char name[MAX_DNS_NAME_LENGTH];
+
+  /* the result */
+  char result[MAX_DNS_NAME_LENGTH];
   
   /* Method to call on result */
   GetAuthorityResultProcessor proc;
@@ -308,8 +330,23 @@ struct GetPseuAuthorityHandle
   /* timeout task for lookup */
   GNUNET_SCHEDULER_TaskIdentifier timeout;
 
-  /* Head of the authority list */
-  struct AuthorityChain *ahead;
+  /* Authority to shorten */
+  struct AuthorityChain *auth;
+
+  /* handle to namestore request */
+  struct GNUNET_NAMESTORE_QueueEntry* namestore_task;
+};
+
+/**
+ * Namestore queue entries in background
+ */
+struct NamestoreBGTask
+{
+  /* node in heap */
+  struct GNUNET_CONTAINER_HeapNode *node;
+
+  /* queue entry */
+  struct GNUNET_NAMESTORE_QueueEntry *qe;
 };
 
 /**
@@ -319,7 +356,7 @@ struct GetPseuAuthorityHandle
  * @param nh handle to the namestore
  * @param dh handle to the dht
  * @param lz the local zone
- * @param cfg configuration handle
+ * @param c configuration handle
  * @param max_bg_queries maximum amount of background queries
  * @param ignore_pending ignore records that still require user confirmation
  *        on lookup
@@ -329,7 +366,7 @@ int
 gns_resolver_init(struct GNUNET_NAMESTORE_Handle *nh,
                   struct GNUNET_DHT_Handle *dh,
                   struct GNUNET_CRYPTO_ShortHashCode lz,
-                  const struct GNUNET_CONFIGURATION_Handle *cfg,
+                  const struct GNUNET_CONFIGURATION_Handle *c,
                   unsigned long long max_bg_queries,
                   int ignore_pending);