aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gnunet-service-gns_resolver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gns/gnunet-service-gns_resolver.c')
-rw-r--r--src/gns/gnunet-service-gns_resolver.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c
index 1f103f421..f86b07f67 100644
--- a/src/gns/gnunet-service-gns_resolver.c
+++ b/src/gns/gnunet-service-gns_resolver.c
@@ -906,6 +906,9 @@ free_resolver_handle (struct ResolverHandle* rh)
906 GNUNET_NETWORK_socket_close (rh->dns_sock); 906 GNUNET_NETWORK_socket_close (rh->dns_sock);
907 if (NULL != rh->dns_resolver_handle) 907 if (NULL != rh->dns_resolver_handle)
908 GNUNET_RESOLVER_request_cancel (rh->dns_resolver_handle); 908 GNUNET_RESOLVER_request_cancel (rh->dns_resolver_handle);
909
910 if (NULL != rh->rd.data)
911 GNUNET_free ((void*)(rh->rd.data));
909 GNUNET_free(rh); 912 GNUNET_free(rh);
910} 913}
911 914
@@ -2260,7 +2263,7 @@ process_pkey_revocation_result_ns (void *cls,
2260 rh->private_local_zone, 2263 rh->private_local_zone,
2261 GNUNET_GNS_RECORD_REV, 2264 GNUNET_GNS_RECORD_REV,
2262 GNUNET_GNS_TLD, 2265 GNUNET_GNS_TLD,
2263 rh->priv_key, 2266 NULL,
2264 GNUNET_TIME_UNIT_FOREVER_REL, 2267 GNUNET_TIME_UNIT_FOREVER_REL,
2265 GNUNET_NO, 2268 GNUNET_NO,
2266 &background_lookup_result_processor, 2269 &background_lookup_result_processor,
@@ -2275,9 +2278,10 @@ process_pkey_revocation_result_ns (void *cls,
2275 * else resolve again with new authority 2278 * else resolve again with new authority
2276 */ 2279 */
2277 if (strcmp (rh->name, "") == 0) 2280 if (strcmp (rh->name, "") == 0)
2278 rh->proc (rh->proc_cls, rh, 0, NULL); 2281 rh->proc (rh->proc_cls, rh, rh->rd_count, &rh->rd);
2279 else 2282 else
2280 resolve_delegation_ns (rh); 2283 resolve_delegation_ns (rh);
2284
2281 return; 2285 return;
2282} 2286}
2283 2287
@@ -2447,6 +2451,14 @@ process_delegation_result_dht(void* cls,
2447 rh->authority_chain_tail, 2451 rh->authority_chain_tail,
2448 auth); 2452 auth);
2449 2453
2454 if (NULL != rh->rd.data)
2455 GNUNET_free ((void*)rh->rd.data);
2456
2457 rh->rd.data = GNUNET_malloc (rd[i].data_size);
2458 memcpy (&rh->rd, &rd[i], sizeof (struct GNUNET_NAMESTORE_RecordData));
2459 memcpy ((void*)(rh->rd.data), rd[i].data, rd[i].data_size);
2460 rh->rd_count = 1;
2461
2450 /** try to import pkey if private key available */ 2462 /** try to import pkey if private key available */
2451 //if (rh->priv_key && is_canonical (rh->name)) 2463 //if (rh->priv_key && is_canonical (rh->name))
2452 // process_discovered_authority(name, auth->zone, 2464 // process_discovered_authority(name, auth->zone,
@@ -2520,6 +2532,7 @@ process_delegation_result_dht(void* cls,
2520 else 2532 else
2521 rh->proc = &handle_delegation_ns; 2533 rh->proc = &handle_delegation_ns;
2522 2534
2535
2523 /* Check for key revocation and delegate */ 2536 /* Check for key revocation and delegate */
2524 rh->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle, 2537 rh->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle,
2525 &rh->authority, 2538 &rh->authority,
@@ -3147,7 +3160,6 @@ handle_delegation_ns (void* cls, struct ResolverHandle *rh,
3147 } 3160 }
3148 else if (rlh->record_type == GNUNET_GNS_RECORD_PKEY) 3161 else if (rlh->record_type == GNUNET_GNS_RECORD_PKEY)
3149 { 3162 {
3150 GNUNET_assert(rd_count == 1);
3151 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 3163 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
3152 "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried PKEY in NS.\n", 3164 "GNS_PHASE_DELEGATE_NS-%llu: Resolved queried PKEY in NS.\n",
3153 rh->id); 3165 rh->id);
@@ -3432,7 +3444,13 @@ process_delegation_result_ns (void* cls,
3432 GNUNET_CONTAINER_DLL_insert (rh->authority_chain_head, 3444 GNUNET_CONTAINER_DLL_insert (rh->authority_chain_head,
3433 rh->authority_chain_tail, 3445 rh->authority_chain_tail,
3434 auth); 3446 auth);
3447 if (NULL != rh->rd.data)
3448 GNUNET_free ((void*)(rh->rd.data));
3435 3449
3450 rh->rd.data = GNUNET_malloc (rd[i].data_size);
3451 memcpy (&rh->rd, &rd[i], sizeof (struct GNUNET_NAMESTORE_RecordData));
3452 memcpy ((void*)rh->rd.data, rd[i].data, rd[i].data_size);
3453 rh->rd_count = 1;
3436 /* Check for key revocation and delegate */ 3454 /* Check for key revocation and delegate */
3437 rh->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle, 3455 rh->namestore_task = GNUNET_NAMESTORE_lookup_record (namestore_handle,
3438 &rh->authority, 3456 &rh->authority,
@@ -3557,6 +3575,7 @@ gns_resolver_lookup_record (struct GNUNET_CRYPTO_ShortHashCode zone,
3557 rh->private_local_zone = pzone; 3575 rh->private_local_zone = pzone;
3558 rh->only_cached = only_cached; 3576 rh->only_cached = only_cached;
3559 rh->namestore_task = NULL; 3577 rh->namestore_task = NULL;
3578 rh->rd.data = NULL;
3560 3579
3561 GNUNET_CONTAINER_DLL_insert (rlh_head, rlh_tail, rh); 3580 GNUNET_CONTAINER_DLL_insert (rlh_head, rlh_tail, rh);
3562 3581