aboutsummaryrefslogtreecommitdiff
path: root/src/dht/test_dht_topo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/test_dht_topo.c')
-rw-r--r--src/dht/test_dht_topo.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/dht/test_dht_topo.c b/src/dht/test_dht_topo.c
index eb7e80d3b..4830ba629 100644
--- a/src/dht/test_dht_topo.c
+++ b/src/dht/test_dht_topo.c
@@ -326,7 +326,7 @@ timeout_cb (void *cls)
326 * 326 *
327 * @param cls closure with our 'struct GetOperation' 327 * @param cls closure with our 'struct GetOperation'
328 * @param exp when will this value expire 328 * @param exp when will this value expire
329 * @param key key of the result 329 * @param query query hash
330 * @param get_path peers on reply path (or NULL if not recorded) 330 * @param get_path peers on reply path (or NULL if not recorded)
331 * @param get_path_length number of entries in @a get_path 331 * @param get_path_length number of entries in @a get_path
332 * @param put_path peers on the PUT path (or NULL if not recorded) 332 * @param put_path peers on the PUT path (or NULL if not recorded)
@@ -338,7 +338,7 @@ timeout_cb (void *cls)
338static void 338static void
339dht_get_handler (void *cls, 339dht_get_handler (void *cls,
340 struct GNUNET_TIME_Absolute exp, 340 struct GNUNET_TIME_Absolute exp,
341 const struct GNUNET_HashCode *key, 341 const struct GNUNET_HashCode *query,
342 const struct GNUNET_DHT_PathElement *get_path, 342 const struct GNUNET_DHT_PathElement *get_path,
343 unsigned int get_path_length, 343 unsigned int get_path_length,
344 const struct GNUNET_DHT_PathElement *put_path, 344 const struct GNUNET_DHT_PathElement *put_path,
@@ -359,8 +359,15 @@ dht_get_handler (void *cls,
359 GNUNET_break (0); 359 GNUNET_break (0);
360 return; 360 return;
361 } 361 }
362 GNUNET_CRYPTO_hash (key, 362 if (0 != GNUNET_memcmp (query,
363 sizeof(*key), 363 &get_op->key))
364 {
365 /* exact search should only yield exact results */
366 GNUNET_break (0);
367 return;
368 }
369 GNUNET_CRYPTO_hash (query,
370 sizeof(*query),
364 &want); 371 &want);
365 if (0 != memcmp (&want, 372 if (0 != memcmp (&want,
366 data, 373 data,
@@ -370,18 +377,21 @@ dht_get_handler (void *cls,
370 return; 377 return;
371 } 378 }
372 if (0 != 379 if (0 !=
373 GNUNET_DHT_verify_path (key, 380 GNUNET_DHT_verify_path (data,
374 data,
375 size, 381 size,
376 exp, 382 exp,
377 get_path,
378 get_path_length,
379 put_path, 383 put_path,
380 put_path_length, 384 put_path_length,
385 get_path,
386 get_path_length,
381 &get_op->me)) 387 &get_op->me))
382 { 388 {
389 GNUNET_break (0);
383 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 390 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
384 "Path signature verification failed!\n"); 391 "Path signature (%u/%u) verification failed for peer %s!\n",
392 get_path_length,
393 put_path_length,
394 GNUNET_i2s (&get_op->me));
385 } 395 }
386 else 396 else
387 { 397 {