aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dht/test_dht_multipeer.c20
-rw-r--r--src/dht/test_dht_twopeer_path_tracking.c20
2 files changed, 22 insertions, 18 deletions
diff --git a/src/dht/test_dht_multipeer.c b/src/dht/test_dht_multipeer.c
index 5d9adeb56..acc9b1652 100644
--- a/src/dht/test_dht_multipeer.c
+++ b/src/dht/test_dht_multipeer.c
@@ -397,8 +397,10 @@ get_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
397static void 397static void
398get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, 398get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
399 const GNUNET_HashCode * key, 399 const GNUNET_HashCode * key,
400 const struct GNUNET_PeerIdentity *const *get_path, 400 const struct GNUNET_PeerIdentity *get_path,
401 const struct GNUNET_PeerIdentity *const *put_path, 401 unsigned int get_path_length,
402 const struct GNUNET_PeerIdentity *put_path,
403 unsigned int put_path_length,
402 enum GNUNET_BLOCK_Type type, size_t size, const void *data) 404 enum GNUNET_BLOCK_Type type, size_t size, const void *data)
403{ 405{
404 struct TestGetContext *test_get = cls; 406 struct TestGetContext *test_get = cls;
@@ -416,15 +418,15 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
416 if (put_path != NULL) 418 if (put_path != NULL)
417 { 419 {
418 fprintf (stderr, "PUT Path: "); 420 fprintf (stderr, "PUT Path: ");
419 for (i = 0; put_path[i] != NULL; i++) 421 for (i = 0; i<put_path_length; i++)
420 fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (put_path[i])); 422 fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&put_path[i]));
421 fprintf (stderr, "\n"); 423 fprintf (stderr, "\n");
422 } 424 }
423 if (get_path != NULL) 425 if (get_path != NULL)
424 { 426 {
425 fprintf (stderr, "GET Path: "); 427 fprintf (stderr, "GET Path: ");
426 for (i = 0; get_path[i] != NULL; i++) 428 for (i = 0; i < get_path_length; i++)
427 fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (get_path[i])); 429 fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&get_path[i]));
428 fprintf (stderr, "\n"); 430 fprintf (stderr, "\n");
429 } 431 }
430#endif 432#endif
@@ -476,8 +478,8 @@ do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
476 test_get->get_handle = 478 test_get->get_handle =
477 GNUNET_DHT_get_start (test_get->dht_handle, GNUNET_TIME_UNIT_FOREVER_REL, 479 GNUNET_DHT_get_start (test_get->dht_handle, GNUNET_TIME_UNIT_FOREVER_REL,
478 GNUNET_BLOCK_TYPE_TEST, &key, 480 GNUNET_BLOCK_TYPE_TEST, &key,
479 DEFAULT_GET_REPLICATION, route_option, NULL, 0, 481 1, route_option, NULL, 0,
480 NULL, 0, &get_result_iterator, test_get); 482 &get_result_iterator, test_get);
481#if VERBOSE 483#if VERBOSE
482 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting get for uid %u from peer %s\n", 484 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting get for uid %u from peer %s\n",
483 test_get->uid, test_get->daemon->shortname); 485 test_get->uid, test_get->daemon->shortname);
@@ -542,7 +544,7 @@ do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
542 544
543 GNUNET_assert (test_put->dht_handle != NULL); 545 GNUNET_assert (test_put->dht_handle != NULL);
544 outstanding_puts++; 546 outstanding_puts++;
545 GNUNET_DHT_put (test_put->dht_handle, &key, DEFAULT_PUT_REPLICATION, 547 GNUNET_DHT_put (test_put->dht_handle, &key, 1,
546 route_option, GNUNET_BLOCK_TYPE_TEST, sizeof (data), data, 548 route_option, GNUNET_BLOCK_TYPE_TEST, sizeof (data), data,
547 GNUNET_TIME_UNIT_FOREVER_ABS, GNUNET_TIME_UNIT_FOREVER_REL, 549 GNUNET_TIME_UNIT_FOREVER_ABS, GNUNET_TIME_UNIT_FOREVER_REL,
548 &put_finished, test_put); 550 &put_finished, test_put);
diff --git a/src/dht/test_dht_twopeer_path_tracking.c b/src/dht/test_dht_twopeer_path_tracking.c
index 9985939ae..e88b7c8e9 100644
--- a/src/dht/test_dht_twopeer_path_tracking.c
+++ b/src/dht/test_dht_twopeer_path_tracking.c
@@ -190,8 +190,10 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
190void 190void
191get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, 191get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
192 const GNUNET_HashCode * key, 192 const GNUNET_HashCode * key,
193 const struct GNUNET_PeerIdentity *const *get_path, 193 const struct GNUNET_PeerIdentity *get_path,
194 const struct GNUNET_PeerIdentity *const *put_path, 194 unsigned int get_path_length,
195 const struct GNUNET_PeerIdentity *put_path,
196 unsigned int put_path_length,
195 enum GNUNET_BLOCK_Type type, size_t size, const void *data) 197 enum GNUNET_BLOCK_Type type, size_t size, const void *data)
196{ 198{
197 GNUNET_HashCode original_key; /* Key data was stored data under */ 199 GNUNET_HashCode original_key; /* Key data was stored data under */
@@ -218,15 +220,15 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
218 if (put_path != NULL) 220 if (put_path != NULL)
219 { 221 {
220 fprintf (stderr, "PUT Path: "); 222 fprintf (stderr, "PUT Path: ");
221 for (i = 0; put_path[i] != NULL; i++) 223 for (i = 0; i<put_path_length; i++)
222 fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (put_path[i])); 224 fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&put_path[i]));
223 fprintf (stderr, "\n"); 225 fprintf (stderr, "\n");
224 } 226 }
225 if (get_path != NULL) 227 if (get_path != NULL)
226 { 228 {
227 fprintf (stderr, "GET Path: "); 229 fprintf (stderr, "GET Path: ");
228 for (i = 0; get_path[i] != NULL; i++) 230 for (i = 0; i<get_path_length; i++)
229 fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (get_path[i])); 231 fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&get_path[i]));
230 fprintf (stderr, "\n"); 232 fprintf (stderr, "\n");
231 } 233 }
232#endif 234#endif
@@ -249,8 +251,8 @@ do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
249 global_get_handle = 251 global_get_handle =
250 GNUNET_DHT_get_start (peer2dht, GNUNET_TIME_relative_get_forever (), 252 GNUNET_DHT_get_start (peer2dht, GNUNET_TIME_relative_get_forever (),
251 GNUNET_BLOCK_TYPE_TEST, &key, 253 GNUNET_BLOCK_TYPE_TEST, &key,
252 DEFAULT_GET_REPLICATION, GNUNET_DHT_RO_RECORD_ROUTE, 254 1, GNUNET_DHT_RO_RECORD_ROUTE,
253 NULL, 0, NULL, 0, &get_result_iterator, NULL); 255 NULL, 0, &get_result_iterator, NULL);
254} 256}
255 257
256/** 258/**
@@ -281,7 +283,7 @@ do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
281 memset (data, 43, sizeof (data)); 283 memset (data, 43, sizeof (data));
282 284
283 /* Insert the data at the first peer */ 285 /* Insert the data at the first peer */
284 GNUNET_DHT_put (peer1dht, &key, DEFAULT_PUT_REPLICATION, 286 GNUNET_DHT_put (peer1dht, &key, 1,
285 GNUNET_DHT_RO_RECORD_ROUTE, GNUNET_BLOCK_TYPE_TEST, 287 GNUNET_DHT_RO_RECORD_ROUTE, GNUNET_BLOCK_TYPE_TEST,
286 sizeof (data), data, GNUNET_TIME_UNIT_FOREVER_ABS, 288 sizeof (data), data, GNUNET_TIME_UNIT_FOREVER_ABS,
287 GNUNET_TIME_UNIT_FOREVER_REL, &put_finished, NULL); 289 GNUNET_TIME_UNIT_FOREVER_REL, &put_finished, NULL);