[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r17083 - gnunet/src/dht
From: |
gnunet |
Subject: |
[GNUnet-SVN] r17083 - gnunet/src/dht |
Date: |
Tue, 27 Sep 2011 23:11:28 +0200 |
Author: grothoff
Date: 2011-09-27 23:11:28 +0200 (Tue, 27 Sep 2011)
New Revision: 17083
Modified:
gnunet/src/dht/test_dht_multipeer.c
gnunet/src/dht/test_dht_twopeer_path_tracking.c
Log:
make compile
Modified: gnunet/src/dht/test_dht_multipeer.c
===================================================================
--- gnunet/src/dht/test_dht_multipeer.c 2011-09-27 21:07:58 UTC (rev 17082)
+++ gnunet/src/dht/test_dht_multipeer.c 2011-09-27 21:11:28 UTC (rev 17083)
@@ -397,8 +397,10 @@
static void
get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
const GNUNET_HashCode * key,
- const struct GNUNET_PeerIdentity *const *get_path,
- const struct GNUNET_PeerIdentity *const *put_path,
+ const struct GNUNET_PeerIdentity *get_path,
+ unsigned int get_path_length,
+ const struct GNUNET_PeerIdentity *put_path,
+ unsigned int put_path_length,
enum GNUNET_BLOCK_Type type, size_t size, const void
*data)
{
struct TestGetContext *test_get = cls;
@@ -416,15 +418,15 @@
if (put_path != NULL)
{
fprintf (stderr, "PUT Path: ");
- for (i = 0; put_path[i] != NULL; i++)
- fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (put_path[i]));
+ for (i = 0; i<put_path_length; i++)
+ fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&put_path[i]));
fprintf (stderr, "\n");
}
if (get_path != NULL)
{
fprintf (stderr, "GET Path: ");
- for (i = 0; get_path[i] != NULL; i++)
- fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (get_path[i]));
+ for (i = 0; i < get_path_length; i++)
+ fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&get_path[i]));
fprintf (stderr, "\n");
}
#endif
@@ -476,8 +478,8 @@
test_get->get_handle =
GNUNET_DHT_get_start (test_get->dht_handle, GNUNET_TIME_UNIT_FOREVER_REL,
GNUNET_BLOCK_TYPE_TEST, &key,
- DEFAULT_GET_REPLICATION, route_option, NULL, 0,
- NULL, 0, &get_result_iterator, test_get);
+ 1, route_option, NULL, 0,
+ &get_result_iterator, test_get);
#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting get for uid %u from peer
%s\n",
test_get->uid, test_get->daemon->shortname);
@@ -542,7 +544,7 @@
GNUNET_assert (test_put->dht_handle != NULL);
outstanding_puts++;
- GNUNET_DHT_put (test_put->dht_handle, &key, DEFAULT_PUT_REPLICATION,
+ GNUNET_DHT_put (test_put->dht_handle, &key, 1,
route_option, GNUNET_BLOCK_TYPE_TEST, sizeof (data), data,
GNUNET_TIME_UNIT_FOREVER_ABS, GNUNET_TIME_UNIT_FOREVER_REL,
&put_finished, test_put);
Modified: gnunet/src/dht/test_dht_twopeer_path_tracking.c
===================================================================
--- gnunet/src/dht/test_dht_twopeer_path_tracking.c 2011-09-27 21:07:58 UTC
(rev 17082)
+++ gnunet/src/dht/test_dht_twopeer_path_tracking.c 2011-09-27 21:11:28 UTC
(rev 17083)
@@ -190,8 +190,10 @@
void
get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
const GNUNET_HashCode * key,
- const struct GNUNET_PeerIdentity *const *get_path,
- const struct GNUNET_PeerIdentity *const *put_path,
+ const struct GNUNET_PeerIdentity *get_path,
+ unsigned int get_path_length,
+ const struct GNUNET_PeerIdentity *put_path,
+ unsigned int put_path_length,
enum GNUNET_BLOCK_Type type, size_t size, const void
*data)
{
GNUNET_HashCode original_key; /* Key data was stored data under */
@@ -218,15 +220,15 @@
if (put_path != NULL)
{
fprintf (stderr, "PUT Path: ");
- for (i = 0; put_path[i] != NULL; i++)
- fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (put_path[i]));
+ for (i = 0; i<put_path_length; i++)
+ fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&put_path[i]));
fprintf (stderr, "\n");
}
if (get_path != NULL)
{
fprintf (stderr, "GET Path: ");
- for (i = 0; get_path[i] != NULL; i++)
- fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (get_path[i]));
+ for (i = 0; i<get_path_length; i++)
+ fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&get_path[i]));
fprintf (stderr, "\n");
}
#endif
@@ -249,8 +251,8 @@
global_get_handle =
GNUNET_DHT_get_start (peer2dht, GNUNET_TIME_relative_get_forever (),
GNUNET_BLOCK_TYPE_TEST, &key,
- DEFAULT_GET_REPLICATION,
GNUNET_DHT_RO_RECORD_ROUTE,
- NULL, 0, NULL, 0, &get_result_iterator, NULL);
+ 1, GNUNET_DHT_RO_RECORD_ROUTE,
+ NULL, 0, &get_result_iterator, NULL);
}
/**
@@ -281,7 +283,7 @@
memset (data, 43, sizeof (data));
/* Insert the data at the first peer */
- GNUNET_DHT_put (peer1dht, &key, DEFAULT_PUT_REPLICATION,
+ GNUNET_DHT_put (peer1dht, &key, 1,
GNUNET_DHT_RO_RECORD_ROUTE, GNUNET_BLOCK_TYPE_TEST,
sizeof (data), data, GNUNET_TIME_UNIT_FOREVER_ABS,
GNUNET_TIME_UNIT_FOREVER_REL, &put_finished, NULL);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r17083 - gnunet/src/dht,
gnunet <=