diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-03-04 11:26:26 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-03-04 11:26:26 +0000 |
commit | 5c779811684d383940d6e3766ace4bdce7bc0ae6 (patch) | |
tree | c8aeeee7e987d8d69f8bd195f02428c49028f9ae /src/gns/gnunet-service-gns_resolver.c | |
parent | 6927a8b2ec77eb4403dab98ae7df8d9e882ba6ae (diff) | |
download | gnunet-5c779811684d383940d6e3766ace4bdce7bc0ae6.tar.gz gnunet-5c779811684d383940d6e3766ace4bdce7bc0ae6.zip |
-presumably better fix for instantly resolving names in master zone
Diffstat (limited to 'src/gns/gnunet-service-gns_resolver.c')
-rw-r--r-- | src/gns/gnunet-service-gns_resolver.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c index 8e4de4b7d..d1e958961 100644 --- a/src/gns/gnunet-service-gns_resolver.c +++ b/src/gns/gnunet-service-gns_resolver.c | |||
@@ -365,7 +365,7 @@ struct GNS_ResolverHandle | |||
365 | /** | 365 | /** |
366 | * Use only cache | 366 | * Use only cache |
367 | */ | 367 | */ |
368 | int only_cached; | 368 | enum GNUNET_GNS_LocalOptions options; |
369 | 369 | ||
370 | /** | 370 | /** |
371 | * Desired type for the resolution. | 371 | * Desired type for the resolution. |
@@ -1779,7 +1779,7 @@ handle_gns_resolution_result (void *cls, | |||
1779 | g2dc->rh->proc = &handle_gns2dns_result; | 1779 | g2dc->rh->proc = &handle_gns2dns_result; |
1780 | g2dc->rh->proc_cls = rh; | 1780 | g2dc->rh->proc_cls = rh; |
1781 | g2dc->rh->record_type = GNUNET_GNSRECORD_TYPE_ANY; | 1781 | g2dc->rh->record_type = GNUNET_GNSRECORD_TYPE_ANY; |
1782 | g2dc->rh->only_cached = GNUNET_NO; | 1782 | g2dc->rh->options = GNUNET_GNS_LO_DEFAULT; |
1783 | g2dc->rh->loop_limiter = rh->loop_limiter + 1; | 1783 | g2dc->rh->loop_limiter = rh->loop_limiter + 1; |
1784 | rh->g2dc = g2dc; | 1784 | rh->g2dc = g2dc; |
1785 | start_resolver_lookup (g2dc->rh); | 1785 | start_resolver_lookup (g2dc->rh); |
@@ -2011,7 +2011,9 @@ handle_namecache_block_response (void *cls, | |||
2011 | 2011 | ||
2012 | GNUNET_assert (NULL != rh->namecache_qe); | 2012 | GNUNET_assert (NULL != rh->namecache_qe); |
2013 | rh->namecache_qe = NULL; | 2013 | rh->namecache_qe = NULL; |
2014 | if ( (GNUNET_NO == rh->only_cached) && | 2014 | if ( ( (GNUNET_GNS_LO_DEFAULT == rh->options) || |
2015 | ( (GNUNET_GNS_LO_LOCAL_MASTER == rh->options) && | ||
2016 | (ac != rh->ac_head) ) ) && | ||
2015 | ( (NULL == block) || | 2017 | ( (NULL == block) || |
2016 | (0 == GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_ntoh (block->expiration_time)).rel_value_us) ) ) | 2018 | (0 == GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_ntoh (block->expiration_time)).rel_value_us) ) ) |
2017 | { | 2019 | { |
@@ -2303,7 +2305,7 @@ start_resolver_lookup (struct GNS_ResolverHandle *rh) | |||
2303 | * @param record_type the record type to look up | 2305 | * @param record_type the record type to look up |
2304 | * @param name the name to look up | 2306 | * @param name the name to look up |
2305 | * @param shorten_key a private key for use with PSEU import (can be NULL) | 2307 | * @param shorten_key a private key for use with PSEU import (can be NULL) |
2306 | * @param only_cached #GNUNET_NO to only check locally not DHT for performance | 2308 | * @param options local options to control local lookup |
2307 | * @param proc the processor to call on result | 2309 | * @param proc the processor to call on result |
2308 | * @param proc_cls the closure to pass to @a proc | 2310 | * @param proc_cls the closure to pass to @a proc |
2309 | * @return handle to cancel operation | 2311 | * @return handle to cancel operation |
@@ -2313,7 +2315,7 @@ GNS_resolver_lookup (const struct GNUNET_CRYPTO_EcdsaPublicKey *zone, | |||
2313 | uint32_t record_type, | 2315 | uint32_t record_type, |
2314 | const char *name, | 2316 | const char *name, |
2315 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_key, | 2317 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_key, |
2316 | int only_cached, | 2318 | enum GNUNET_GNS_LocalOptions options, |
2317 | GNS_ResultProcessor proc, void *proc_cls) | 2319 | GNS_ResultProcessor proc, void *proc_cls) |
2318 | { | 2320 | { |
2319 | struct GNS_ResolverHandle *rh; | 2321 | struct GNS_ResolverHandle *rh; |
@@ -2330,7 +2332,7 @@ GNS_resolver_lookup (const struct GNUNET_CRYPTO_EcdsaPublicKey *zone, | |||
2330 | rh->authority_zone = *zone; | 2332 | rh->authority_zone = *zone; |
2331 | rh->proc = proc; | 2333 | rh->proc = proc; |
2332 | rh->proc_cls = proc_cls; | 2334 | rh->proc_cls = proc_cls; |
2333 | rh->only_cached = only_cached; | 2335 | rh->options = options; |
2334 | rh->record_type = record_type; | 2336 | rh->record_type = record_type; |
2335 | rh->name = GNUNET_strdup (name); | 2337 | rh->name = GNUNET_strdup (name); |
2336 | rh->name_resolution_pos = strlen (name); | 2338 | rh->name_resolution_pos = strlen (name); |