-bump name to 97
[oweals/gnunet.git] / src / mesh / test_mesh_local.c
index 25ccf7b2e03c07d7ce1605f310c608b974d78ae9..4ecef81e20b1f32b662e491f8864558f84daedcd 100644 (file)
@@ -20,7 +20,7 @@
 
 /**
  * @file mesh/test_mesh_local.c
- * @brief test mesh local: test of mesh tunnels with just one peer
+ * @brief test mesh local: test of mesh channels with just one peer
  * @author Bartlomiej Polot
  */
 
@@ -98,7 +98,7 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
  * @param channel connection to the other end
  * @param channel_ctx place to store local state associated with the channel
  * @param message the actual message
- * 
+ *
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
@@ -130,14 +130,14 @@ data_callback (void *cls, struct GNUNET_MESH_Channel *channel,
  *         (can be NULL -- that's not an error)
  */
 static void *
-inbound_tunnel (void *cls, struct GNUNET_MESH_Channel *channel,
+inbound_channel (void *cls, struct GNUNET_MESH_Channel *channel,
                 const struct GNUNET_PeerIdentity *initiator,
                 uint32_t port)
 {
   long id = (long) cls;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "received incoming tunnel on peer %d, port %u\n",
+              "received incoming channel on peer %d, port %u\n",
               id, port);
   if (id != 2L)
   {
@@ -190,11 +190,11 @@ static struct GNUNET_MESH_MessageHandler handlers2[] = {
 
 /**
  * Data send callback: fillbuffer with test packet.
- * 
+ *
  * @param cls Closure (unused).
  * @param size Buffer size.
  * @param buf Buffer to fill.
- * 
+ *
  * @return size of test packet.
  */
 static size_t
@@ -216,7 +216,7 @@ do_send (void *cls, size_t size, void *buf)
 
 /**
  * Connect to other client and send data
- * 
+ *
  * @param cls Closue (unused).
  * @param tc TaskContext.
  */
@@ -238,13 +238,13 @@ do_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 /**
  * Initialize framework and start test
- * 
+ *
  * @param cls Closure (unused).
  * @param cfg Configuration handle.
  * @param peer Testing peer handle.
  */
 static void
-run (void *cls, 
+run (void *cls,
      const struct GNUNET_CONFIGURATION_Handle *cfg,
      struct GNUNET_TESTING_Peer *peer)
 {
@@ -257,14 +257,14 @@ run (void *cls,
                                     NULL);
   mesh_peer_1 = GNUNET_MESH_connect (cfg,       /* configuration */
                                      (void *) 1L,     /* cls */
-                                     &inbound_tunnel,   /* inbound new hndlr */
+                                     &inbound_channel,   /* inbound new hndlr */
                                      &inbound_end,      /* inbound end hndlr */
                                      handlers1, /* traffic handlers */
                                      NULL);     /* ports offered */
 
   mesh_peer_2 = GNUNET_MESH_connect (cfg,       /* configuration */
                                      (void *) 2L,     /* cls */
-                                     &inbound_tunnel,   /* inbound new hndlr */
+                                     &inbound_channel,   /* inbound new hndlr */
                                      &inbound_end,      /* inbound end hndlr */
                                      handlers2, /* traffic handlers */
                                      ports);     /* ports offered */
@@ -278,7 +278,10 @@ run (void *cls,
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "YAY! CONNECTED TO MESH :D\n");
   }
-  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &do_connect, NULL);
+  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (
+                                  GNUNET_TIME_UNIT_SECONDS,
+                                  2),
+                                &do_connect, NULL);
 }