aboutsummaryrefslogtreecommitdiff
path: root/src/mesh
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2012-07-25 17:57:46 +0000
committerBart Polot <bart@net.in.tum.de>2012-07-25 17:57:46 +0000
commit851989a46fc5cf5f792ac3f53fa45b29c783a15a (patch)
treee9045922ce0f99a36ca8fb9e4f53d8c54d03569d /src/mesh
parent2855795582ac050551da45a04a687e73c2c3d0d8 (diff)
downloadgnunet-851989a46fc5cf5f792ac3f53fa45b29c783a15a.tar.gz
gnunet-851989a46fc5cf5f792ac3f53fa45b29c783a15a.zip
- initialize pointer
Diffstat (limited to 'src/mesh')
-rw-r--r--src/mesh/mesh_api.c1
-rw-r--r--src/mesh/test_mesh_api.c2
-rw-r--r--src/mesh/test_mesh_local_1.c2
-rw-r--r--src/mesh/test_mesh_local_2.c2
-rw-r--r--src/mesh/test_mesh_regex.c6
-rw-r--r--src/mesh/test_mesh_small.c14
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)
1196 return 0; 1196 return 0;
1197 } 1197 }
1198 tsize = 0; 1198 tsize = 0;
1199 next = h->th_head;
1199 while ((NULL != (th = next)) && (size >= th->size)) 1200 while ((NULL != (th = next)) && (size >= th->size))
1200 { 1201 {
1201 t = th->tunnel; 1202 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,
101 static const GNUNET_MESH_ApplicationType app[] = 101 static const GNUNET_MESH_ApplicationType app[] =
102 { 1, 2, 3, 4, 5, 6, 7, 8, 0 }; 102 { 1, 2, 3, 4, 5, 6, 7, 8, 0 };
103 103
104 mesh = GNUNET_MESH_connect (cfg, 10, NULL, NULL, NULL, handlers, app); 104 mesh = GNUNET_MESH_connect (cfg, NULL, NULL, NULL, handlers, app);
105 if (NULL == mesh) 105 if (NULL == mesh)
106 { 106 {
107 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "test: Couldn't connect to mesh :(\n"); 107 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,
250 (GNUNET_TIME_UNIT_SECONDS, 20), &do_abort, 250 (GNUNET_TIME_UNIT_SECONDS, 20), &do_abort,
251 NULL); 251 NULL);
252 mesh_peer_1 = GNUNET_MESH_connect (cfg, /* configuration */ 252 mesh_peer_1 = GNUNET_MESH_connect (cfg, /* configuration */
253 10, /* queue size */
254 (void *) &one, /* cls */ 253 (void *) &one, /* cls */
255 &inbound_tunnel, /* inbound new hndlr */ 254 &inbound_tunnel, /* inbound new hndlr */
256 &inbound_end, /* inbound end hndlr */ 255 &inbound_end, /* inbound end hndlr */
@@ -258,7 +257,6 @@ run (void *cls,
258 app1); /* apps offered */ 257 app1); /* apps offered */
259 258
260 mesh_peer_2 = GNUNET_MESH_connect (cfg, /* configuration */ 259 mesh_peer_2 = GNUNET_MESH_connect (cfg, /* configuration */
261 10, /* queue size */
262 (void *) &two, /* cls */ 260 (void *) &two, /* cls */
263 &inbound_tunnel, /* inbound new hndlr */ 261 &inbound_tunnel, /* inbound new hndlr */
264 &inbound_end, /* inbound end hndlr */ 262 &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)
226 226
227 test_task = GNUNET_SCHEDULER_NO_TASK; 227 test_task = GNUNET_SCHEDULER_NO_TASK;
228 mesh_peer_1 = GNUNET_MESH_connect (cfg, /* configuration */ 228 mesh_peer_1 = GNUNET_MESH_connect (cfg, /* configuration */
229 10, /* queue size */
230 (void *) &one, /* cls */ 229 (void *) &one, /* cls */
231 &inbound_tunnel, /* inbound new hndlr */ 230 &inbound_tunnel, /* inbound new hndlr */
232 &inbound_end, /* inbound end hndlr */ 231 &inbound_end, /* inbound end hndlr */
@@ -250,7 +249,6 @@ run (void *cls,
250 (GNUNET_TIME_UNIT_SECONDS, 20), &do_abort, 249 (GNUNET_TIME_UNIT_SECONDS, 20), &do_abort,
251 NULL); 250 NULL);
252 mesh_peer_2 = GNUNET_MESH_connect (cfg, /* configuration */ 251 mesh_peer_2 = GNUNET_MESH_connect (cfg, /* configuration */
253 10, /* queue size */
254 (void *) &two, /* cls */ 252 (void *) &two, /* cls */
255 &inbound_tunnel, /* inbound new hndlr */ 253 &inbound_tunnel, /* inbound new hndlr */
256 &inbound_end, /* inbound end hndlr */ 254 &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,
288 GNUNET_i2s (peer)); 288 GNUNET_i2s (peer));
289 regex_peers++; 289 regex_peers++;
290 290
291 GNUNET_MESH_notify_transmit_ready(t[i], 0, 0, 291 GNUNET_MESH_notify_transmit_ready(t[i], GNUNET_NO,
292 GNUNET_TIME_UNIT_FOREVER_REL, 292 GNUNET_TIME_UNIT_FOREVER_REL,
293 peer, 293 peer,
294 sizeof(struct GNUNET_MessageHeader), 294 sizeof(struct GNUNET_MessageHeader),
@@ -427,7 +427,7 @@ peergroup_ready (void *cls, const char *emsg)
427 427
428 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 428 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
429 "Connect to mesh\n"); 429 "Connect to mesh\n");
430 h1 = GNUNET_MESH_connect (d->cfg, 5, (void *) 1L, 430 h1 = GNUNET_MESH_connect (d->cfg, (void *) 1L,
431 NULL, 431 NULL,
432 NULL, 432 NULL,
433 handlers, 433 handlers,
@@ -437,7 +437,7 @@ peergroup_ready (void *cls, const char *emsg)
437 { 437 {
438 ok[i] = GNUNET_NO; 438 ok[i] = GNUNET_NO;
439 d = GNUNET_TESTING_daemon_get (pg, 10 + i); 439 d = GNUNET_TESTING_daemon_get (pg, 10 + i);
440 h2[i] = GNUNET_MESH_connect (d->cfg, 5, (void *) (long) (i + 2), 440 h2[i] = GNUNET_MESH_connect (d->cfg, (void *) (long) (i + 2),
441 &incoming_tunnel, 441 &incoming_tunnel,
442 &tunnel_cleaner, 442 &tunnel_cleaner,
443 handlers, 443 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)
284 struct GNUNET_MESH_TransmitHandle *th; 284 struct GNUNET_MESH_TransmitHandle *th;
285 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) 285 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0)
286 return; 286 return;
287 th = GNUNET_MESH_notify_transmit_ready (t, GNUNET_NO, 0, 287 th = GNUNET_MESH_notify_transmit_ready (t, GNUNET_NO,
288 GNUNET_TIME_UNIT_FOREVER_REL, &d2->id, 288 GNUNET_TIME_UNIT_FOREVER_REL, &d2->id,
289 sizeof (struct GNUNET_MessageHeader), 289 sizeof (struct GNUNET_MessageHeader),
290 &tmt_rdy, (void *) 1L); 290 &tmt_rdy, (void *) 1L);
@@ -384,7 +384,7 @@ data_callback (void *cls, struct GNUNET_MESH_Tunnel *tunnel, void **tunnel_ctx,
384 { 384 {
385 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 385 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
386 " received ack %u\n", data_ack); 386 " received ack %u\n", data_ack);
387 GNUNET_MESH_notify_transmit_ready (tunnel, GNUNET_NO, 0, 387 GNUNET_MESH_notify_transmit_ready (tunnel, GNUNET_NO,
388 GNUNET_TIME_UNIT_FOREVER_REL, sender, 388 GNUNET_TIME_UNIT_FOREVER_REL, sender,
389 sizeof (struct GNUNET_MessageHeader), 389 sizeof (struct GNUNET_MessageHeader),
390 &tmt_rdy, (void *) 1L); 390 &tmt_rdy, (void *) 1L);
@@ -414,7 +414,7 @@ data_callback (void *cls, struct GNUNET_MESH_Tunnel *tunnel, void **tunnel_ctx,
414 GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok); 414 GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
415 if (SPEED != test || 1002 == ok) 415 if (SPEED != test || 1002 == ok)
416 { 416 {
417 GNUNET_MESH_notify_transmit_ready (tunnel, GNUNET_NO, 0, 417 GNUNET_MESH_notify_transmit_ready (tunnel, GNUNET_NO,
418 GNUNET_TIME_UNIT_FOREVER_REL, sender, 418 GNUNET_TIME_UNIT_FOREVER_REL, sender,
419 sizeof (struct GNUNET_MessageHeader), 419 sizeof (struct GNUNET_MessageHeader),
420 &tmt_rdy, (void *) 1L); 420 &tmt_rdy, (void *) 1L);
@@ -606,7 +606,7 @@ ch (void *cls, const struct GNUNET_PeerIdentity *peer,
606 data_received = 0; 606 data_received = 0;
607 data_sent = 0; 607 data_sent = 0;
608 start_time = GNUNET_TIME_absolute_get(); 608 start_time = GNUNET_TIME_absolute_get();
609 GNUNET_MESH_notify_transmit_ready (t, GNUNET_NO, 0, 609 GNUNET_MESH_notify_transmit_ready (t, GNUNET_NO,
610 GNUNET_TIME_UNIT_FOREVER_REL, dest, 610 GNUNET_TIME_UNIT_FOREVER_REL, dest,
611 sizeof (struct GNUNET_MessageHeader), 611 sizeof (struct GNUNET_MessageHeader),
612 &tmt_rdy, (void *) 1L); 612 &tmt_rdy, (void *) 1L);
@@ -678,13 +678,13 @@ connect_mesh_service (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
678 GNUNET_i2s (&d3->id)); 678 GNUNET_i2s (&d3->id));
679 } 679 }
680#endif 680#endif
681 h1 = GNUNET_MESH_connect (d1->cfg, 5, (void *) 1L, NULL, &tunnel_cleaner, 681 h1 = GNUNET_MESH_connect (d1->cfg, (void *) 1L, NULL, &tunnel_cleaner,
682 handlers, &app); 682 handlers, &app);
683 h2 = GNUNET_MESH_connect (d2->cfg, 5, (void *) 2L, &incoming_tunnel, 683 h2 = GNUNET_MESH_connect (d2->cfg, (void *) 2L, &incoming_tunnel,
684 &tunnel_cleaner, handlers, &app); 684 &tunnel_cleaner, handlers, &app);
685 if (test == MULTICAST) 685 if (test == MULTICAST)
686 { 686 {
687 h3 = GNUNET_MESH_connect (d3->cfg, 5, (void *) 3L, &incoming_tunnel, 687 h3 = GNUNET_MESH_connect (d3->cfg, (void *) 3L, &incoming_tunnel,
688 &tunnel_cleaner, handlers, &app); 688 &tunnel_cleaner, handlers, &app);
689 } 689 }
690 t = GNUNET_MESH_tunnel_create (h1, NULL, &ch, &dh, (void *) 1L); 690 t = GNUNET_MESH_tunnel_create (h1, NULL, &ch, &dh, (void *) 1L);