- initialize pointer
authorBart Polot <bart@net.in.tum.de>
Wed, 25 Jul 2012 17:57:46 +0000 (17:57 +0000)
committerBart Polot <bart@net.in.tum.de>
Wed, 25 Jul 2012 17:57:46 +0000 (17:57 +0000)
src/mesh/mesh_api.c
src/mesh/test_mesh_api.c
src/mesh/test_mesh_local_1.c
src/mesh/test_mesh_local_2.c
src/mesh/test_mesh_regex.c
src/mesh/test_mesh_small.c

index aee4c2a7b7072fd287b10c8388e998e18cd210ff..27630d3af1011d7cadaa52874d0fa132757c29b2 100644 (file)
@@ -1196,6 +1196,7 @@ send_callback (void *cls, size_t size, void *buf)
     return 0;
   }
   tsize = 0;
+  next = h->th_head;
   while ((NULL != (th = next)) && (size >= th->size))
   {
     t = th->tunnel;
index c2944911faf95be733e4762ab93f374fa02da928..dcac19085ef4348d716ea38252ecc72f512c5386 100644 (file)
@@ -101,7 +101,7 @@ run (void *cls,
   static const GNUNET_MESH_ApplicationType app[] =
     { 1, 2, 3, 4, 5, 6, 7, 8, 0 };
 
-  mesh = GNUNET_MESH_connect (cfg, 10, NULL, NULL, NULL, handlers, app);
+  mesh = GNUNET_MESH_connect (cfg, NULL, NULL, NULL, handlers, app);
   if (NULL == mesh)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "test: Couldn't connect to mesh :(\n");
index 20898833096c46cf3a3c26eaff4c26ccc27611c7..d143f0913353e3de700070375245a834a5abb592 100644 (file)
@@ -250,7 +250,6 @@ run (void *cls,
                                     (GNUNET_TIME_UNIT_SECONDS, 20), &do_abort,
                                     NULL);
   mesh_peer_1 = GNUNET_MESH_connect (cfg,       /* configuration */
-                                     10,        /* queue size */
                                      (void *) &one,     /* cls */
                                      &inbound_tunnel,   /* inbound new hndlr */
                                      &inbound_end,      /* inbound end hndlr */
@@ -258,7 +257,6 @@ run (void *cls,
                                      app1);     /* apps offered */
 
   mesh_peer_2 = GNUNET_MESH_connect (cfg,       /* configuration */
-                                     10,        /* queue size */
                                      (void *) &two,     /* cls */
                                      &inbound_tunnel,   /* inbound new hndlr */
                                      &inbound_end,      /* inbound end hndlr */
index f80f1f99e8b0a3660a5f11d66f6d5e969388c8cc..d4b5e004b36a63c082c9bd07d82453fd97a22286 100644 (file)
@@ -226,7 +226,6 @@ do_connect_peer_1 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
   test_task = GNUNET_SCHEDULER_NO_TASK;
   mesh_peer_1 = GNUNET_MESH_connect (cfg,       /* configuration */
-                                     10,        /* queue size */
                                      (void *) &one,     /* cls */
                                      &inbound_tunnel,   /* inbound new hndlr */
                                      &inbound_end,      /* inbound end hndlr */
@@ -250,7 +249,6 @@ run (void *cls,
                                     (GNUNET_TIME_UNIT_SECONDS, 20), &do_abort,
                                     NULL);
   mesh_peer_2 = GNUNET_MESH_connect (cfg,       /* configuration */
-                                     10,        /* queue size */
                                      (void *) &two,     /* cls */
                                      &inbound_tunnel,   /* inbound new hndlr */
                                      &inbound_end,      /* inbound end hndlr */
index 002ffa8de0e68e51249006e031e9e5b1190d6567..f88822bc8d541a9d777005d8e63424b6f7c9e1a4 100644 (file)
@@ -288,7 +288,7 @@ ch (void *cls, const struct GNUNET_PeerIdentity *peer,
               GNUNET_i2s (peer));
   regex_peers++;
  
-  GNUNET_MESH_notify_transmit_ready(t[i], 0, 0,
+  GNUNET_MESH_notify_transmit_ready(t[i], GNUNET_NO,
                                     GNUNET_TIME_UNIT_FOREVER_REL,
                                     peer,
                                     sizeof(struct GNUNET_MessageHeader),
@@ -427,7 +427,7 @@ peergroup_ready (void *cls, const char *emsg)
 
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Connect to mesh\n");
-  h1 = GNUNET_MESH_connect (d->cfg, 5, (void *) 1L,
+  h1 = GNUNET_MESH_connect (d->cfg, (void *) 1L,
                             NULL,
                             NULL,
                             handlers,
@@ -437,7 +437,7 @@ peergroup_ready (void *cls, const char *emsg)
   {
     ok[i] = GNUNET_NO;
     d = GNUNET_TESTING_daemon_get (pg, 10 + i);
-    h2[i] = GNUNET_MESH_connect (d->cfg, 5, (void *) (long) (i + 2),
+    h2[i] = GNUNET_MESH_connect (d->cfg, (void *) (long) (i + 2),
                                  &incoming_tunnel,
                                  &tunnel_cleaner,
                                  handlers,
index 45d38c33c17029b45ecfe4b1d3cd06f673978b15..9aa54096454f9bb928749e4252b5a12086c062a9 100644 (file)
@@ -284,7 +284,7 @@ data_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   struct GNUNET_MESH_TransmitHandle *th;
   if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0)
     return;
-  th = GNUNET_MESH_notify_transmit_ready (t, GNUNET_NO, 0,
+  th = GNUNET_MESH_notify_transmit_ready (t, GNUNET_NO,
                                     GNUNET_TIME_UNIT_FOREVER_REL, &d2->id,
                                     sizeof (struct GNUNET_MessageHeader),
                                     &tmt_rdy, (void *) 1L);
@@ -384,7 +384,7 @@ data_callback (void *cls, struct GNUNET_MESH_Tunnel *tunnel, void **tunnel_ctx,
     {
       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               " received ack %u\n", data_ack);
-      GNUNET_MESH_notify_transmit_ready (tunnel, GNUNET_NO, 0,
+      GNUNET_MESH_notify_transmit_ready (tunnel, GNUNET_NO,
                                         GNUNET_TIME_UNIT_FOREVER_REL, sender,
                                         sizeof (struct GNUNET_MessageHeader),
                                         &tmt_rdy, (void *) 1L);
@@ -414,7 +414,7 @@ data_callback (void *cls, struct GNUNET_MESH_Tunnel *tunnel, void **tunnel_ctx,
     GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
     if (SPEED != test || 1002 == ok)
     {
-      GNUNET_MESH_notify_transmit_ready (tunnel, GNUNET_NO, 0,
+      GNUNET_MESH_notify_transmit_ready (tunnel, GNUNET_NO,
                                         GNUNET_TIME_UNIT_FOREVER_REL, sender,
                                         sizeof (struct GNUNET_MessageHeader),
                                         &tmt_rdy, (void *) 1L);
@@ -606,7 +606,7 @@ ch (void *cls, const struct GNUNET_PeerIdentity *peer,
     data_received = 0;
     data_sent = 0;
     start_time = GNUNET_TIME_absolute_get();
-    GNUNET_MESH_notify_transmit_ready (t, GNUNET_NO, 0,
+    GNUNET_MESH_notify_transmit_ready (t, GNUNET_NO,
                                        GNUNET_TIME_UNIT_FOREVER_REL, dest,
                                        sizeof (struct GNUNET_MessageHeader),
                                        &tmt_rdy, (void *) 1L);
@@ -678,13 +678,13 @@ connect_mesh_service (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
                 GNUNET_i2s (&d3->id));
   }
 #endif
-  h1 = GNUNET_MESH_connect (d1->cfg, 5, (void *) 1L, NULL, &tunnel_cleaner,
+  h1 = GNUNET_MESH_connect (d1->cfg, (void *) 1L, NULL, &tunnel_cleaner,
                             handlers, &app);
-  h2 = GNUNET_MESH_connect (d2->cfg, 5, (void *) 2L, &incoming_tunnel,
+  h2 = GNUNET_MESH_connect (d2->cfg, (void *) 2L, &incoming_tunnel,
                             &tunnel_cleaner, handlers, &app);
   if (test == MULTICAST)
   {
-    h3 = GNUNET_MESH_connect (d3->cfg, 5, (void *) 3L, &incoming_tunnel,
+    h3 = GNUNET_MESH_connect (d3->cfg, (void *) 3L, &incoming_tunnel,
                               &tunnel_cleaner, handlers, &app);
   }
   t = GNUNET_MESH_tunnel_create (h1, NULL, &ch, &dh, (void *) 1L);