From 851989a46fc5cf5f792ac3f53fa45b29c783a15a Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Wed, 25 Jul 2012 17:57:46 +0000 Subject: [PATCH] - initialize pointer --- src/mesh/mesh_api.c | 1 + src/mesh/test_mesh_api.c | 2 +- src/mesh/test_mesh_local_1.c | 2 -- src/mesh/test_mesh_local_2.c | 2 -- src/mesh/test_mesh_regex.c | 6 +++--- src/mesh/test_mesh_small.c | 14 +++++++------- 6 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c index aee4c2a7b..27630d3af 100644 --- a/src/mesh/mesh_api.c +++ b/src/mesh/mesh_api.c @@ -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; diff --git a/src/mesh/test_mesh_api.c b/src/mesh/test_mesh_api.c index c2944911f..dcac19085 100644 --- a/src/mesh/test_mesh_api.c +++ b/src/mesh/test_mesh_api.c @@ -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"); diff --git a/src/mesh/test_mesh_local_1.c b/src/mesh/test_mesh_local_1.c index 208988330..d143f0913 100644 --- a/src/mesh/test_mesh_local_1.c +++ b/src/mesh/test_mesh_local_1.c @@ -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 */ diff --git a/src/mesh/test_mesh_local_2.c b/src/mesh/test_mesh_local_2.c index f80f1f99e..d4b5e004b 100644 --- a/src/mesh/test_mesh_local_2.c +++ b/src/mesh/test_mesh_local_2.c @@ -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 */ diff --git a/src/mesh/test_mesh_regex.c b/src/mesh/test_mesh_regex.c index 002ffa8de..f88822bc8 100644 --- a/src/mesh/test_mesh_regex.c +++ b/src/mesh/test_mesh_regex.c @@ -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, diff --git a/src/mesh/test_mesh_small.c b/src/mesh/test_mesh_small.c index 45d38c33c..9aa540964 100644 --- a/src/mesh/test_mesh_small.c +++ b/src/mesh/test_mesh_small.c @@ -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); -- 2.25.1