gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r27372 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r27372 - gnunet/src/mesh
Date: Wed, 5 Jun 2013 20:09:12 +0200

Author: bartpolot
Date: 2013-06-05 20:09:12 +0200 (Wed, 05 Jun 2013)
New Revision: 27372

Modified:
   gnunet/src/mesh/test_mesh2_local.c
Log:
- fixes

Modified: gnunet/src/mesh/test_mesh2_local.c
===================================================================
--- gnunet/src/mesh/test_mesh2_local.c  2013-06-05 18:08:48 UTC (rev 27371)
+++ gnunet/src/mesh/test_mesh2_local.c  2013-06-05 18:09:12 UTC (rev 27372)
@@ -19,8 +19,8 @@
 */
 
 /**
- * @file mesh/test_mesh_local_1.c
- * @brief test mesh local: test of tunnels with just one peer
+ * @file mesh/test_mesh2_local.c
+ * @brief test mesh2 local: test of mesh2 tunnels with just one peer
  * @author Bartlomiej Polot
  */
 
@@ -81,7 +81,7 @@
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: ABORT\n");
   result = GNUNET_SYSERR;
-  abort_task = 0;
+  abort_task = GNUNET_SCHEDULER_NO_TASK;
   if (GNUNET_SCHEDULER_NO_TASK != shutdown_task)
   {
     GNUNET_SCHEDULER_cancel (shutdown_task);
@@ -188,6 +188,17 @@
 static struct GNUNET_MESH_MessageHandler handlers2[] = { {NULL, 0, 0} };
 
 
+static size_t
+do_send (void *cls, size_t size, void *buf)
+{
+  struct GNUNET_MessageHeader *m = buf;
+
+  m->size = htons (sizeof (struct GNUNET_MessageHeader));
+  m->type = htons (1);
+  GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader));
+  return sizeof (struct GNUNET_MessageHeader);
+}
+
 /**
  * Start looking for a peer by type
  */
@@ -199,6 +210,10 @@
   GNUNET_TESTING_peer_get_identity (me, &id);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: CONNECT BY PORT\n");
   t = GNUNET_MESH_tunnel_create (mesh_peer_1, NULL, &id, 1);
+  GNUNET_MESH_notify_transmit_ready (t, GNUNET_NO,
+                                     GNUNET_TIME_UNIT_FOREVER_REL,
+                                     sizeof (struct GNUNET_MessageHeader),
+                                     &do_send, NULL);
 }
 
 
@@ -215,7 +230,7 @@
   me = peer;
   abort_task =
       GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
-                                    (GNUNET_TIME_UNIT_SECONDS, 120), &do_abort,
+                                    (GNUNET_TIME_UNIT_SECONDS, 15), &do_abort,
                                     NULL);
   mesh_peer_1 = GNUNET_MESH_connect (cfg,       /* configuration */
                                      (void *) 1L,     /* cls */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]