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.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c
index c58190599..e14a05d45 100644
--- a/src/gns/gnunet-service-gns_resolver.c
+++ b/src/gns/gnunet-service-gns_resolver.c
@@ -658,6 +658,8 @@ resolver_lookup_get_next_label (struct GNS_ResolverHandle *rh)
658 } 658 }
659 rh->protocol = pe->p_proto; 659 rh->protocol = pe->p_proto;
660 rh->service = se->s_port; 660 rh->service = se->s_port;
661 GNUNET_free (proto_name);
662 GNUNET_free (srv_name);
661 } 663 }
662 return ret; 664 return ret;
663} 665}
@@ -1017,6 +1019,7 @@ recursive_dns_resolution (struct GNS_ResolverHandle *rh)
1017 struct GNUNET_DNSPARSER_Packet *p; 1019 struct GNUNET_DNSPARSER_Packet *p;
1018 char *dns_request; 1020 char *dns_request;
1019 size_t dns_request_length; 1021 size_t dns_request_length;
1022 int ret;
1020 1023
1021 ac = rh->ac_tail; 1024 ac = rh->ac_tail;
1022 GNUNET_assert (NULL != ac); 1025 GNUNET_assert (NULL != ac);
@@ -1049,11 +1052,16 @@ recursive_dns_resolution (struct GNS_ResolverHandle *rh)
1049 UINT16_MAX); 1052 UINT16_MAX);
1050 p->flags.opcode = GNUNET_TUN_DNS_OPCODE_QUERY; 1053 p->flags.opcode = GNUNET_TUN_DNS_OPCODE_QUERY;
1051 p->flags.recursion_desired = 1; 1054 p->flags.recursion_desired = 1;
1052 if (GNUNET_OK != 1055 ret = GNUNET_DNSPARSER_pack (p,
1053 GNUNET_DNSPARSER_pack (p, 1024, &dns_request, &dns_request_length)) 1056 1024,
1057 &dns_request,
1058 &dns_request_length);
1059 if (GNUNET_OK != ret)
1054 { 1060 {
1055 GNUNET_break (0); 1061 GNUNET_break (0);
1056 rh->proc (rh->proc_cls, 0, NULL); 1062 rh->proc (rh->proc_cls,
1063 0,
1064 NULL);
1057 GNS_resolver_lookup_cancel (rh); 1065 GNS_resolver_lookup_cancel (rh);
1058 } 1066 }
1059 else 1067 else
@@ -1069,7 +1077,8 @@ recursive_dns_resolution (struct GNS_ResolverHandle *rh)
1069 &fail_resolution, 1077 &fail_resolution,
1070 rh); 1078 rh);
1071 } 1079 }
1072 GNUNET_free (dns_request); 1080 if (GNUNET_SYSERR != ret)
1081 GNUNET_free (dns_request);
1073 GNUNET_DNSPARSER_free_packet (p); 1082 GNUNET_DNSPARSER_free_packet (p);
1074} 1083}
1075 1084
@@ -1460,10 +1469,10 @@ handle_gns_resolution_result (void *cls,
1460 vpn_ctx->rd_data = GNUNET_malloc (vpn_ctx->rd_data_size); 1469 vpn_ctx->rd_data = GNUNET_malloc (vpn_ctx->rd_data_size);
1461 vpn_ctx->rd_count = rd_count; 1470 vpn_ctx->rd_count = rd_count;
1462 GNUNET_assert (vpn_ctx->rd_data_size == 1471 GNUNET_assert (vpn_ctx->rd_data_size ==
1463 GNUNET_GNSRECORD_records_serialize (rd_count, 1472 (size_t) GNUNET_GNSRECORD_records_serialize (rd_count,
1464 rd, 1473 rd,
1465 vpn_ctx->rd_data_size, 1474 vpn_ctx->rd_data_size,
1466 vpn_ctx->rd_data)); 1475 vpn_ctx->rd_data));
1467 vpn_ctx->vpn_request = GNUNET_VPN_redirect_to_peer (vpn_handle, 1476 vpn_ctx->vpn_request = GNUNET_VPN_redirect_to_peer (vpn_handle,
1468 af, 1477 af,
1469 ntohs (vpn->proto), 1478 ntohs (vpn->proto),
@@ -2360,7 +2369,8 @@ GNS_resolver_lookup (const struct GNUNET_CRYPTO_EcdsaPublicKey *zone,
2360 uint32_t record_type, 2369 uint32_t record_type,
2361 const char *name, 2370 const char *name,
2362 enum GNUNET_GNS_LocalOptions options, 2371 enum GNUNET_GNS_LocalOptions options,
2363 GNS_ResultProcessor proc, void *proc_cls) 2372 GNS_ResultProcessor proc,
2373 void *proc_cls)
2364{ 2374{
2365 struct GNS_ResolverHandle *rh; 2375 struct GNS_ResolverHandle *rh;
2366 2376