cleanup
authorChristian Grothoff <christian@grothoff.org>
Wed, 28 Sep 2011 07:52:34 +0000 (07:52 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 28 Sep 2011 07:52:34 +0000 (07:52 +0000)
src/dht/gnunet-service-dht.h
src/dht/test_dht_multipeer.c
src/dht/test_dht_twopeer_path_tracking.c

index 7cacdba7a1314557dbe80299217725a57351590b..2877a156b81d048300d9ce6ec33c72d5b08381e8 100644 (file)
@@ -35,7 +35,6 @@
  */
 extern const struct GNUNET_CONFIGURATION_Handle *GDS_cfg;
 
-
 /**
  * Our handle to the BLOCK library.
  */
index acc9b165233399d18b2f470bda7f717ce84bfc29..8133c7576672edb8efb2091f8c91b01829fe5bb9 100644 (file)
@@ -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 @@ do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
                   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 @@ setup_puts_and_gets (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
  * 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 @@ create_topology ()
  * @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)
 {
index e88b7c8e969237fd08b377db8fa6abe56815418a..5be36c4a1eb68354f6e0ec62bb22351f046dd387 100644 (file)
@@ -187,7 +187,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
  * @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,21 +239,6 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
   GNUNET_SCHEDULER_add_now (&finish_testing, NULL);
 }
 
-/**
- * Start the GET request for the same key/data that was inserted.
- */
-static void
-do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
-{
-  GNUNET_HashCode key;          /* Key for data lookup */
-
-  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 (),
-                            GNUNET_BLOCK_TYPE_TEST, &key,
-                            1, GNUNET_DHT_RO_RECORD_ROUTE,
-                            NULL, 0, &get_result_iterator, NULL);
-}
 
 /**
  * Called when the PUT request has been transmitted to the DHT service.
@@ -262,12 +247,18 @@ do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 static void
 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)");
-  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
-                                (GNUNET_TIME_UNIT_SECONDS, 10), &do_get, NULL);
+  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 (),
+                            GNUNET_BLOCK_TYPE_TEST, &key,
+                            1, GNUNET_DHT_RO_RECORD_ROUTE,
+                            NULL, 0, &get_result_iterator, NULL);
 }
 
 /**
@@ -298,7 +289,7 @@ do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
  * 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,