aboutsummaryrefslogtreecommitdiff
path: root/src/gns
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-04-29 10:56:15 +0200
committerChristian Grothoff <christian@grothoff.org>2018-04-29 10:56:15 +0200
commitce2864cfaa27e55096b480bf35db5f8cee2a5e7e (patch)
treebe47c017d1467870000aa1a507eab3c995304179 /src/gns
parent823215c974ccb1ef3cad9eb1082999cd1b910416 (diff)
downloadgnunet-ce2864cfaa27e55096b480bf35db5f8cee2a5e7e.tar.gz
gnunet-ce2864cfaa27e55096b480bf35db5f8cee2a5e7e.zip
add option to disable namecache, add velocity calculation and delay correction to zonemaster, fix some ftbfs from recent NAMESTORE API change
Diffstat (limited to 'src/gns')
-rw-r--r--src/gns/gns.conf.in3
-rw-r--r--src/gns/gnunet-service-gns.c10
-rw-r--r--src/gns/gnunet-service-gns_resolver.c19
3 files changed, 17 insertions, 15 deletions
diff --git a/src/gns/gns.conf.in b/src/gns/gns.conf.in
index d48a213e9..2e49a4c60 100644
--- a/src/gns/gns.conf.in
+++ b/src/gns/gns.conf.in
@@ -22,9 +22,6 @@ MAX_PARALLEL_BACKGROUND_QUERIES = 1000
22# called via NSS or other mechanisms). 22# called via NSS or other mechanisms).
23INTERCEPT_DNS = YES 23INTERCEPT_DNS = YES
24 24
25# Using caching (start with namestore), or always ask DHT?
26USE_CACHE = YES
27
28# PREFIX = valgrind --leak-check=full --track-origins=yes 25# PREFIX = valgrind --leak-check=full --track-origins=yes
29 26
30# Zones 27# Zones
diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c
index 90cd47e1d..c376ddfcc 100644
--- a/src/gns/gnunet-service-gns.c
+++ b/src/gns/gnunet-service-gns.c
@@ -229,14 +229,14 @@ GNS_get_tld (const char *name)
229/** 229/**
230 * Task run during shutdown. 230 * Task run during shutdown.
231 * 231 *
232 * @param cls unused 232 * @param cls unused, NULL
233 * @param tc unused
234 */ 233 */
235static void 234static void
236shutdown_task (void *cls) 235shutdown_task (void *cls)
237{ 236{
238 struct GNS_TopLevelDomain *tld; 237 struct GNS_TopLevelDomain *tld;
239 238
239 (void) cls;
240 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 240 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
241 "Shutting down!\n"); 241 "Shutting down!\n");
242 GNS_interceptor_done (); 242 GNS_interceptor_done ();
@@ -283,6 +283,7 @@ client_disconnect_cb (void *cls,
283 struct ClientLookupHandle *clh; 283 struct ClientLookupHandle *clh;
284 struct GnsClient *gc = app_ctx; 284 struct GnsClient *gc = app_ctx;
285 285
286 (void) cls;
286 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 287 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
287 "Client %p disconnected\n", 288 "Client %p disconnected\n",
288 client); 289 client);
@@ -314,6 +315,8 @@ client_connect_cb (void *cls,
314 struct GNUNET_MQ_Handle *mq) 315 struct GNUNET_MQ_Handle *mq)
315{ 316{
316 struct GnsClient *gc; 317 struct GnsClient *gc;
318
319 (void) cls;
317 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 320 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
318 "Client %p connected\n", 321 "Client %p connected\n",
319 client); 322 client);
@@ -383,6 +386,7 @@ check_lookup (void *cls,
383 size_t msg_size; 386 size_t msg_size;
384 const char* name; 387 const char* name;
385 388
389 (void) cls;
386 msg_size = ntohs (l_msg->header.size); 390 msg_size = ntohs (l_msg->header.size);
387 if (msg_size < sizeof (struct LookupMessage)) 391 if (msg_size < sizeof (struct LookupMessage))
388 { 392 {
@@ -479,6 +483,8 @@ read_service_conf (void *cls,
479 struct GNUNET_CRYPTO_EcdsaPublicKey pk; 483 struct GNUNET_CRYPTO_EcdsaPublicKey pk;
480 struct GNS_TopLevelDomain *tld; 484 struct GNS_TopLevelDomain *tld;
481 485
486 (void) cls;
487 (void) section;
482 if (option[0] != '.') 488 if (option[0] != '.')
483 return; 489 return;
484 if (GNUNET_OK != 490 if (GNUNET_OK !=
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c
index 745a2f3bd..92e03bc69 100644
--- a/src/gns/gnunet-service-gns_resolver.c
+++ b/src/gns/gnunet-service-gns_resolver.c
@@ -501,7 +501,7 @@ static struct CacheOps *co_tail;
501/** 501/**
502 * Use namecache 502 * Use namecache
503 */ 503 */
504static int use_cache; 504static int disable_cache;
505 505
506/** 506/**
507 * Global configuration. 507 * Global configuration.
@@ -2478,7 +2478,7 @@ recursive_gns_resolution_namecache (struct GNS_ResolverHandle *rh)
2478 GNUNET_GNSRECORD_query_from_public_key (&ac->authority_info.gns_authority, 2478 GNUNET_GNSRECORD_query_from_public_key (&ac->authority_info.gns_authority,
2479 ac->label, 2479 ac->label,
2480 &query); 2480 &query);
2481 if (GNUNET_YES == use_cache) 2481 if (GNUNET_YES != disable_cache)
2482 { 2482 {
2483 rh->namecache_qe 2483 rh->namecache_qe
2484 = GNUNET_NAMECACHE_lookup_block (namecache_handle, 2484 = GNUNET_NAMECACHE_lookup_block (namecache_handle,
@@ -2489,7 +2489,8 @@ recursive_gns_resolution_namecache (struct GNS_ResolverHandle *rh)
2489 } 2489 }
2490 else 2490 else
2491 { 2491 {
2492 start_dht_request (rh, &query); 2492 start_dht_request (rh,
2493 &query);
2493 } 2494 }
2494} 2495}
2495 2496
@@ -2816,13 +2817,11 @@ GNS_resolver_init (struct GNUNET_NAMECACHE_Handle *nc,
2816 dht_lookup_heap = 2817 dht_lookup_heap =
2817 GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); 2818 GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN);
2818 max_allowed_background_queries = max_bg_queries; 2819 max_allowed_background_queries = max_bg_queries;
2819 if (GNUNET_SYSERR == (use_cache = 2820 disable_cache = GNUNET_CONFIGURATION_get_value_yesno (cfg,
2820 GNUNET_CONFIGURATION_get_value_yesno (c, 2821 "namecache",
2821 "gns", 2822 "DISABLE");
2822 "USE_CACHE"))) 2823 if (GNUNET_YES == disable_cache)
2823 use_cache = GNUNET_YES; 2824 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
2824 if (GNUNET_NO == use_cache)
2825 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
2826 "Namecache disabled\n"); 2825 "Namecache disabled\n");
2827 vpn_handle = GNUNET_VPN_connect (cfg); 2826 vpn_handle = GNUNET_VPN_connect (cfg);
2828} 2827}