aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-service-xdht_datacache.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/gnunet-service-xdht_datacache.c')
-rw-r--r--src/dht/gnunet-service-xdht_datacache.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/dht/gnunet-service-xdht_datacache.c b/src/dht/gnunet-service-xdht_datacache.c
index df2e17187..3af22e791 100644
--- a/src/dht/gnunet-service-xdht_datacache.c
+++ b/src/dht/gnunet-service-xdht_datacache.c
@@ -150,6 +150,11 @@ struct GetRequestContext
150 /** 150 /**
151 * 151 *
152 */ 152 */
153 struct GNUNET_PeerIdentity source_peer;
154
155 /**
156 *
157 */
153 unsigned int current_trail_index; 158 unsigned int current_trail_index;
154 159
155 /** 160 /**
@@ -225,7 +230,8 @@ datacache_get_iterator (void *cls,
225 } 230 }
226 GDS_NEIGHBOURS_send_get_result (exp, key, put_path_length, put_path, 231 GDS_NEIGHBOURS_send_get_result (exp, key, put_path_length, put_path,
227 type, size, data, get_path, ctx->get_path_length, 232 type, size, data, get_path, ctx->get_path_length,
228 ctx->current_trail_index, &(ctx->next_hop)); 233 ctx->current_trail_index, &(ctx->next_hop),
234 &(ctx->source_peer));
229 235
230 /* forward to other peers */ 236 /* forward to other peers */
231 GDS_ROUTING_process (type, exp, key, put_path_length, put_path, 0, NULL, 237 GDS_ROUTING_process (type, exp, key, put_path_length, put_path, 0, NULL,
@@ -290,7 +296,8 @@ GDS_DATACACHE_handle_get (const struct GNUNET_HashCode * key,
290 uint32_t get_path_length, 296 uint32_t get_path_length,
291 struct GNUNET_PeerIdentity *get_path, 297 struct GNUNET_PeerIdentity *get_path,
292 unsigned int current_trail_index, 298 unsigned int current_trail_index,
293 struct GNUNET_PeerIdentity *next_hop) 299 struct GNUNET_PeerIdentity *next_hop,
300 struct GNUNET_PeerIdentity *source_peer)
294{ 301{
295 struct GetRequestContext ctx; 302 struct GetRequestContext ctx;
296 unsigned int r; 303 unsigned int r;
@@ -307,7 +314,8 @@ GDS_DATACACHE_handle_get (const struct GNUNET_HashCode * key,
307 ctx.reply_bf = reply_bf; 314 ctx.reply_bf = reply_bf;
308 ctx.reply_bf_mutator = reply_bf_mutator; 315 ctx.reply_bf_mutator = reply_bf_mutator;
309 ctx.get_path_length = get_path_length; 316 ctx.get_path_length = get_path_length;
310 memcpy (&(ctx.next_hop), next_hop, sizeof (struct GNUNET_PeerIdentity)); 317 if (next_hop != NULL)
318 memcpy (&(ctx.next_hop), next_hop, sizeof (struct GNUNET_PeerIdentity));
311 ctx.current_trail_index = current_trail_index; 319 ctx.current_trail_index = current_trail_index;
312 /* FIXME: add the get path into ctx and then call gds_neighbours_handle_get*/ 320 /* FIXME: add the get path into ctx and then call gds_neighbours_handle_get*/
313 int i = 0; 321 int i = 0;