[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r17086 - gnunet/src/dht
From: |
gnunet |
Subject: |
[GNUnet-SVN] r17086 - gnunet/src/dht |
Date: |
Wed, 28 Sep 2011 09:52:35 +0200 |
Author: grothoff
Date: 2011-09-28 09:52:34 +0200 (Wed, 28 Sep 2011)
New Revision: 17086
Modified:
gnunet/src/dht/gnunet-service-dht.h
gnunet/src/dht/test_dht_multipeer.c
gnunet/src/dht/test_dht_twopeer_path_tracking.c
Log:
cleanup
Modified: gnunet/src/dht/gnunet-service-dht.h
===================================================================
--- gnunet/src/dht/gnunet-service-dht.h 2011-09-28 06:51:49 UTC (rev 17085)
+++ gnunet/src/dht/gnunet-service-dht.h 2011-09-28 07:52:34 UTC (rev 17086)
@@ -35,7 +35,6 @@
*/
extern const struct GNUNET_CONFIGURATION_Handle *GDS_cfg;
-
/**
* Our handle to the BLOCK library.
*/
Modified: gnunet/src/dht/test_dht_multipeer.c
===================================================================
--- gnunet/src/dht/test_dht_multipeer.c 2011-09-28 06:51:49 UTC (rev 17085)
+++ gnunet/src/dht/test_dht_multipeer.c 2011-09-28 07:52:34 UTC (rev 17086)
@@ -28,7 +28,7 @@
#include "gnunet_dht_service.h"
/* DEFINES */
-#define VERBOSE GNUNET_NO
+#define VERBOSE GNUNET_YES
/* Timeout for entire testcase */
#define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 5)
@@ -549,8 +549,8 @@
GNUNET_TIME_UNIT_FOREVER_ABS, GNUNET_TIME_UNIT_FOREVER_REL,
&put_finished, test_put);
test_put->disconnect_task =
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_get_forever (),
- &put_disconnect_task, test_put);
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
+ &put_disconnect_task, test_put);
GNUNET_SCHEDULER_add_now (&do_put, test_put->next);
}
@@ -609,7 +609,7 @@
* The emsg variable is NULL on success (peers connected), and non-NULL on
* failure (peers failed to connect).
*/
-void
+static void
topology_callback (void *cls, const struct GNUNET_PeerIdentity *first,
const struct GNUNET_PeerIdentity *second, uint32_t distance,
const struct GNUNET_CONFIGURATION_Handle *first_cfg,
@@ -752,7 +752,7 @@
* @param d the daemon handle (pretty useless at this point, remove?)
* @param emsg non-null on failure
*/
-void
+static void
hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id,
struct GNUNET_TESTING_Daemon *d, const char *emsg)
{
Modified: gnunet/src/dht/test_dht_twopeer_path_tracking.c
===================================================================
--- gnunet/src/dht/test_dht_twopeer_path_tracking.c 2011-09-28 06:51:49 UTC
(rev 17085)
+++ gnunet/src/dht/test_dht_twopeer_path_tracking.c 2011-09-28 07:52:34 UTC
(rev 17086)
@@ -187,7 +187,7 @@
* @param size number of bytes in data
* @param data pointer to the result data
*/
-void
+static void
get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
const GNUNET_HashCode * key,
const struct GNUNET_PeerIdentity *get_path,
@@ -239,14 +239,20 @@
GNUNET_SCHEDULER_add_now (&finish_testing, NULL);
}
+
/**
- * Start the GET request for the same key/data that was inserted.
+ * Called when the PUT request has been transmitted to the DHT service.
+ * Schedule the GET request for some time in the future.
*/
static void
-do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+put_finished (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_HashCode key; /* Key for data lookup */
+ GNUNET_SCHEDULER_cancel (die_task);
+ die_task =
+ GNUNET_SCHEDULER_add_delayed (GET_TIMEOUT, &end_badly,
+ "waiting for get response (data not
found)");
memset (&key, 42, sizeof (GNUNET_HashCode)); /* Set the key to the same
thing as when data was inserted */
global_get_handle =
GNUNET_DHT_get_start (peer2dht, GNUNET_TIME_relative_get_forever (),
@@ -256,21 +262,6 @@
}
/**
- * Called when the PUT request has been transmitted to the DHT service.
- * Schedule the GET request for some time in the future.
- */
-static void
-put_finished (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
-{
- GNUNET_SCHEDULER_cancel (die_task);
- die_task =
- GNUNET_SCHEDULER_add_delayed (GET_TIMEOUT, &end_badly,
- "waiting for get response (data not
found)");
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
- (GNUNET_TIME_UNIT_SECONDS, 10), &do_get, NULL);
-}
-
-/**
* Set up some data, and call API PUT function
*/
static void
@@ -298,7 +289,7 @@
* The emsg variable is NULL on success (peers connected), and non-NULL on
* failure (peers failed to connect).
*/
-void
+static void
topology_callback (void *cls, const struct GNUNET_PeerIdentity *first,
const struct GNUNET_PeerIdentity *second, uint32_t distance,
const struct GNUNET_CONFIGURATION_Handle *first_cfg,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r17086 - gnunet/src/dht,
gnunet <=