aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gnunet-service-gns_resolver.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gns/gnunet-service-gns_resolver.h')
-rw-r--r--src/gns/gnunet-service-gns_resolver.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/gns/gnunet-service-gns_resolver.h b/src/gns/gnunet-service-gns_resolver.h
index 326aff22d..18d32698a 100644
--- a/src/gns/gnunet-service-gns_resolver.h
+++ b/src/gns/gnunet-service-gns_resolver.h
@@ -5,9 +5,13 @@
5#include "gnunet_dht_service.h" 5#include "gnunet_dht_service.h"
6 6
7#define DHT_OPERATION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 3) 7#define DHT_OPERATION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 3)
8#define GNUNET_GNS_DEFAULT_LOOKUP_TIMEOUT \
9 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
8#define DHT_LOOKUP_TIMEOUT DHT_OPERATION_TIMEOUT 10#define DHT_LOOKUP_TIMEOUT DHT_OPERATION_TIMEOUT
9#define DHT_GNS_REPLICATION_LEVEL 5 11#define DHT_GNS_REPLICATION_LEVEL 5
10 12
13#define GNUNET_GNS_MAX_PARALLEL_LOOKUPS 500
14
11/* 15/*
12 * DLL to hold the authority chain 16 * DLL to hold the authority chain
13 * we had to pass in the resolution process 17 * we had to pass in the resolution process
@@ -113,8 +117,17 @@ struct ResolverHandle
113 /* a handle for dht lookups. should be NULL if no lookups are in progress */ 117 /* a handle for dht lookups. should be NULL if no lookups are in progress */
114 struct GNUNET_DHT_GetHandle *get_handle; 118 struct GNUNET_DHT_GetHandle *get_handle;
115 119
116 /* timeout task for dht lookups */ 120 /* timeout set for this lookup task */
117 GNUNET_SCHEDULER_TaskIdentifier dht_timeout_task; 121 struct GNUNET_TIME_Relative timeout;
122
123 /* timeout task for the lookup */
124 GNUNET_SCHEDULER_TaskIdentifier timeout_task;
125
126 /* continuation to call on timeout */
127 GNUNET_SCHEDULER_Task timeout_cont;
128
129 /* closure for timeout cont */
130 void* timeout_cont_cls;
118 131
119 /* called when resolution phase finishes */ 132 /* called when resolution phase finishes */
120 ResolutionResultProcessor proc; 133 ResolutionResultProcessor proc;
@@ -127,12 +140,15 @@ struct ResolverHandle
127 140
128 /* DLL to store the authority chain */ 141 /* DLL to store the authority chain */
129 struct AuthorityChain *authority_chain_tail; 142 struct AuthorityChain *authority_chain_tail;
130 143
131 /* status of the resolution result */ 144 /* status of the resolution result */
132 enum ResolutionStatus status; 145 enum ResolutionStatus status;
133 146
134 struct GNUNET_CRYPTO_RsaPrivateKey *priv_key; 147 struct GNUNET_CRYPTO_RsaPrivateKey *priv_key;
135 148
149 /* the heap node associated with this lookup, null if timeout is set */
150 struct GNUNET_CONTAINER_HeapNode *dht_heap_node;
151
136}; 152};
137 153
138 154
@@ -211,8 +227,8 @@ struct GetPseuAuthorityHandle
211 /* a handle for dht lookups. should be NULL if no lookups are in progress */ 227 /* a handle for dht lookups. should be NULL if no lookups are in progress */
212 struct GNUNET_DHT_GetHandle *get_handle; 228 struct GNUNET_DHT_GetHandle *get_handle;
213 229
214 /* timeout task for dht lookups */ 230 /* timeout task for lookup */
215 GNUNET_SCHEDULER_TaskIdentifier dht_timeout; 231 GNUNET_SCHEDULER_TaskIdentifier timeout;
216}; 232};
217 233
218/** 234/**
@@ -242,6 +258,7 @@ gns_resolver_lookup_record(struct GNUNET_CRYPTO_ShortHashCode zone,
242 uint32_t record_type, 258 uint32_t record_type,
243 const char* name, 259 const char* name,
244 struct GNUNET_CRYPTO_RsaPrivateKey *key, 260 struct GNUNET_CRYPTO_RsaPrivateKey *key,
261 struct GNUNET_TIME_Relative timeout,
245 RecordLookupProcessor proc, 262 RecordLookupProcessor proc,
246 void* cls); 263 void* cls);
247 264