aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-service-xdht_clients.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/gnunet-service-xdht_clients.c')
-rw-r--r--src/dht/gnunet-service-xdht_clients.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/dht/gnunet-service-xdht_clients.c b/src/dht/gnunet-service-xdht_clients.c
index 9e489b6d9..3185243b7 100644
--- a/src/dht/gnunet-service-xdht_clients.c
+++ b/src/dht/gnunet-service-xdht_clients.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2009, 2010, 2011 GNUnet e.V. 3 Copyright (C) 2009, 2010, 2011, 2016 GNUnet e.V.
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -651,7 +651,8 @@ GDS_CLIENTS_handle_reply (struct GNUNET_TIME_Absolute expiration,
651 _("Could not pass reply to client, message too big!\n")); 651 _("Could not pass reply to client, message too big!\n"));
652 return; 652 return;
653 } 653 }
654 DEBUG("reply FOR DATA_SIZE = %lu\n",msize); 654 DEBUG ("reply FOR DATA_SIZE = %u\n",
655 (unsigned int) msize);
655 pm = GNUNET_malloc (msize + sizeof (struct PendingMessage)); 656 pm = GNUNET_malloc (msize + sizeof (struct PendingMessage));
656 reply = (struct GNUNET_DHT_ClientResultMessage *) &pm[1]; 657 reply = (struct GNUNET_DHT_ClientResultMessage *) &pm[1];
657 pm->msg = &reply->header; 658 pm->msg = &reply->header;
@@ -664,17 +665,23 @@ GDS_CLIENTS_handle_reply (struct GNUNET_TIME_Absolute expiration,
664 reply->expiration = GNUNET_TIME_absolute_hton (expiration); 665 reply->expiration = GNUNET_TIME_absolute_hton (expiration);
665 reply->key = *key; 666 reply->key = *key;
666 paths = (struct GNUNET_PeerIdentity *) &reply[1]; 667 paths = (struct GNUNET_PeerIdentity *) &reply[1];
667 GNUNET_memcpy (paths, put_path, 668 GNUNET_memcpy (paths,
668 sizeof (struct GNUNET_PeerIdentity) * put_path_length); 669 put_path,
669 GNUNET_memcpy (&paths[put_path_length], get_path, 670 sizeof (struct GNUNET_PeerIdentity) * put_path_length);
670 sizeof (struct GNUNET_PeerIdentity) * get_path_length); 671 GNUNET_memcpy (&paths[put_path_length],
671 GNUNET_memcpy (&paths[get_path_length + put_path_length], data, data_size); 672 get_path,
673 sizeof (struct GNUNET_PeerIdentity) * get_path_length);
674 GNUNET_memcpy (&paths[get_path_length + put_path_length],
675 data,
676 data_size);
672 frc.do_copy = GNUNET_NO; 677 frc.do_copy = GNUNET_NO;
673 frc.pm = pm; 678 frc.pm = pm;
674 frc.data = data; 679 frc.data = data;
675 frc.data_size = data_size; 680 frc.data_size = data_size;
676 frc.type = type; 681 frc.type = type;
677 GNUNET_CONTAINER_multihashmap_get_multiple (forward_map, key, &forward_reply, 682 GNUNET_CONTAINER_multihashmap_get_multiple (forward_map,
683 key,
684 &forward_reply,
678 &frc); 685 &frc);
679 if (GNUNET_NO == frc.do_copy) 686 if (GNUNET_NO == frc.do_copy)
680 { 687 {