From 309372ff522a9bb0bf5437c760f50296586c5922 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 24 Aug 2013 10:23:08 +0000 Subject: [PATCH] -towards translating .+ names in GNS records --- src/gns/gnunet-service-gns_resolver.c | 61 ++++++++++++++++++++------- 1 file changed, 46 insertions(+), 15 deletions(-) diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c index 3cb05a371..22ef0deb3 100644 --- a/src/gns/gnunet-service-gns_resolver.c +++ b/src/gns/gnunet-service-gns_resolver.c @@ -1138,9 +1138,13 @@ handle_gns_resolution_result (void *cls, const char *vname; struct GNUNET_HashCode vhash; int af; - char **scratch; - unsigned int scratch_len; - + char scratch[UINT16_MAX]; + size_t scratch_off; + size_t scratch_start; + size_t off; + struct GNUNET_NAMESTORE_RecordData rd_new[rd_count]; + unsigned int rd_off; + if (0 == rh->name_resolution_pos) { /* top-level match, are we done yet? */ @@ -1210,20 +1214,52 @@ handle_gns_resolution_result (void *cls, } /* convert relative names in record values to absolute names, using 'scratch' array for memory allocations */ - scratch = NULL; - scratch_len = 0; + scratch_off = 0; + rd_off = 0; for (i=0;iproc (rh->proc_cls, rd_count, rd); + rh->proc (rh->proc_cls, rd_off, rd_new); GNS_resolver_lookup_cancel (rh); - for (i=0;i