aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gnunet-gns.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-03-04 11:26:26 +0000
committerChristian Grothoff <christian@grothoff.org>2014-03-04 11:26:26 +0000
commit5c779811684d383940d6e3766ace4bdce7bc0ae6 (patch)
treec8aeeee7e987d8d69f8bd195f02428c49028f9ae /src/gns/gnunet-gns.c
parent6927a8b2ec77eb4403dab98ae7df8d9e882ba6ae (diff)
downloadgnunet-5c779811684d383940d6e3766ace4bdce7bc0ae6.tar.gz
gnunet-5c779811684d383940d6e3766ace4bdce7bc0ae6.zip
-presumably better fix for instantly resolving names in master zone
Diffstat (limited to 'src/gns/gnunet-gns.c')
-rw-r--r--src/gns/gnunet-gns.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gns/gnunet-gns.c b/src/gns/gnunet-gns.c
index 7951eb569..f59239b9d 100644
--- a/src/gns/gnunet-gns.c
+++ b/src/gns/gnunet-gns.c
@@ -66,9 +66,9 @@ static char *zone_ego_name;
66static char *public_key; 66static char *public_key;
67 67
68/** 68/**
69 * Set to #GNUNET_YES if we must not use the DHT (only local lookup). 69 * Set to GNUNET_GNS_LO_LOCAL_MASTER if we are looking up in the master zone.
70 */ 70 */
71static int only_cached; 71static enum GNUNET_GNS_LocalOptions local_options;
72 72
73/** 73/**
74 * raw output 74 * raw output
@@ -216,7 +216,7 @@ lookup_with_keys (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey,
216 lookup_name, 216 lookup_name,
217 pkey, 217 pkey,
218 rtype, 218 rtype,
219 only_cached, 219 local_options,
220 shorten_key, 220 shorten_key,
221 &process_lookup_result, 221 &process_lookup_result,
222 lookup_name); 222 lookup_name);
@@ -349,13 +349,16 @@ identity_master_cb (void *cls,
349 return; 349 return;
350 } 350 }
351 GNUNET_IDENTITY_ego_get_public_key (ego, &pkey); 351 GNUNET_IDENTITY_ego_get_public_key (ego, &pkey);
352 /* main name is our own master zone, do no look for that in the DHT */
353 local_options = GNUNET_GNS_LO_LOCAL_MASTER;
354
352 /* if the name is of the form 'label.gnu', never go to the DHT */ 355 /* if the name is of the form 'label.gnu', never go to the DHT */
353 dot = NULL; 356 dot = NULL;
354 if (NULL != lookup_name) 357 if (NULL != lookup_name)
355 dot = strchr (lookup_name, '.'); 358 dot = strchr (lookup_name, '.');
356 if ( (NULL != dot) && 359 if ( (NULL != dot) &&
357 (0 == strcasecmp (dot, ".gnu")) ) 360 (0 == strcasecmp (dot, ".gnu")) )
358 only_cached = GNUNET_YES; 361 local_options = GNUNET_GNS_LO_NO_DHT;
359 lookup_with_public_key (&pkey); 362 lookup_with_public_key (&pkey);
360} 363}
361 364