From 3742e826ed673e2bf4975c243f4e5f70ed61efc5 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Mon, 27 Feb 2012 16:37:18 +0000 Subject: [PATCH] -fix duh --- src/gns/gnunet-service-gns.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c index 5b60fd6fb..01f43cb7e 100644 --- a/src/gns/gnunet-service-gns.c +++ b/src/gns/gnunet-service-gns.c @@ -338,7 +338,7 @@ process_name_dht_result(void* cls, char* name = NULL; int i; GNUNET_HashCode zone, name_hash; - GNUNET_log(GNUNET_ERROR_TYPE_INFO, "got dht result\n"); + GNUNET_log(GNUNET_ERROR_TYPE_INFO, "got dht result (size=%d)\n", size); if (data == NULL) return; @@ -353,7 +353,7 @@ process_name_dht_result(void* cls, struct GNUNET_NAMESTORE_RecordData rd[num_records]; name = (char*)&nrb[1]; - rb = (struct GNSRecordBlock*)(&nrb[1] + strlen(name) + 2); + rb = (struct GNSRecordBlock*)&name[strlen(name) + 1]; for (i=0; iname); GNUNET_log(GNUNET_ERROR_TYPE_INFO, - "Got type: %d (wanted %d)\n", - rd[i].record_type, rh->query->type); + "Got type: %d raw %d (wanted %d)\n", + rd[i].record_type, rb->type, rh->query->type); GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Got data length: %d\n", rd[i].data_size); GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Got flag %d\n", rd[i].flags); //FIXME class? - if (strcmp(name, rh->name) && + if ((strcmp(name, rh->name) == 0) && (rd[i].record_type == rh->query->type)) { rh->answered++; @@ -1107,7 +1107,7 @@ put_gns_record(void *cls, memcpy(&nrb[1], name, strlen(name) + 1); //FIXME is this 0 terminated??-sure hope so for we use strlen - rb = (struct GNSRecordBlock *)(&nrb[1] + strlen(name) + 1); + rb = (struct GNSRecordBlock *)((char*)&nrb[1] + strlen(name) + 1); for (i=0; i