diff options
author | Gabor X Toth <*@tg-x.net> | 2015-09-27 21:04:34 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2015-09-27 21:04:34 +0000 |
commit | cab1b047ddcac497e14515fc11f097c4aac8ee27 (patch) | |
tree | 7f4e14a8c77d76bef07cb4bbf6b94adcce44d53c /src/multicast/test_multicast.c | |
parent | 51f530b98232f7a9947f29008d161ed0d8e23af4 (diff) | |
download | gnunet-cab1b047ddcac497e14515fc11f097c4aac8ee27.tar.gz gnunet-cab1b047ddcac497e14515fc11f097c4aac8ee27.zip |
multicast/psyc/social: message acks & scheduling
Diffstat (limited to 'src/multicast/test_multicast.c')
-rw-r--r-- | src/multicast/test_multicast.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/multicast/test_multicast.c b/src/multicast/test_multicast.c index a5946f3fd..f35c2885a 100644 --- a/src/multicast/test_multicast.c +++ b/src/multicast/test_multicast.c | |||
@@ -183,7 +183,7 @@ tmit_resume (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
183 | struct TransmitClosure *tmit = cls; | 183 | struct TransmitClosure *tmit = cls; |
184 | if (NULL != tmit->orig_tmit) | 184 | if (NULL != tmit->orig_tmit) |
185 | GNUNET_MULTICAST_origin_to_all_resume (tmit->orig_tmit); | 185 | GNUNET_MULTICAST_origin_to_all_resume (tmit->orig_tmit); |
186 | else | 186 | else if (NULL != tmit->mem_tmit) |
187 | GNUNET_MULTICAST_member_to_origin_resume (tmit->mem_tmit); | 187 | GNUNET_MULTICAST_member_to_origin_resume (tmit->mem_tmit); |
188 | } | 188 | } |
189 | 189 | ||
@@ -453,14 +453,15 @@ member_to_origin () | |||
453 | *tmit = (struct TransmitClosure) {}; | 453 | *tmit = (struct TransmitClosure) {}; |
454 | tmit->data[0] = "abc def"; | 454 | tmit->data[0] = "abc def"; |
455 | tmit->data[1] = "ghi jkl mno"; | 455 | tmit->data[1] = "ghi jkl mno"; |
456 | tmit->data_delay[1] = 1; | 456 | tmit->data_delay[1] = 2; |
457 | tmit->data[2] = "pqr stuw xyz"; | 457 | tmit->data[2] = "pqr stuw xyz"; |
458 | tmit->data_count = 3; | 458 | tmit->data_count = 3; |
459 | 459 | ||
460 | origin_cls.n = 0; | 460 | origin_cls.n = 0; |
461 | origin_cls.msgs_expected = 1; | 461 | origin_cls.msgs_expected = 1; |
462 | 462 | ||
463 | GNUNET_MULTICAST_member_to_origin (member, 1, tmit_notify, tmit); | 463 | tmit->mem_tmit = GNUNET_MULTICAST_member_to_origin (member, 1, |
464 | tmit_notify, tmit); | ||
464 | } | 465 | } |
465 | 466 | ||
466 | 467 | ||
@@ -533,15 +534,19 @@ origin_to_all () | |||
533 | struct TransmitClosure *tmit = &tmit_cls; | 534 | struct TransmitClosure *tmit = &tmit_cls; |
534 | *tmit = (struct TransmitClosure) {}; | 535 | *tmit = (struct TransmitClosure) {}; |
535 | tmit->data[0] = "ABC DEF"; | 536 | tmit->data[0] = "ABC DEF"; |
536 | tmit->data[1] = "GHI JKL MNO"; | 537 | tmit->data[1] = GNUNET_malloc (GNUNET_MULTICAST_FRAGMENT_MAX_PAYLOAD + 1); |
537 | tmit->data_delay[1] = 1; | 538 | for (uint16_t i = 0; i < GNUNET_MULTICAST_FRAGMENT_MAX_PAYLOAD; i++) |
538 | tmit->data[2] = "PQR STUW XYZ"; | 539 | tmit->data[1][i] = (0 == i % 10000) ? '0' + i / 10000 : '_'; |
539 | tmit->data_count = 3; | 540 | tmit->data[2] = "GHI JKL MNO"; |
541 | tmit->data_delay[2] = 2; | ||
542 | tmit->data[3] = "PQR STUW XYZ"; | ||
543 | tmit->data_count = 4; | ||
540 | 544 | ||
541 | origin_cls.n = member_cls.n = 0; | 545 | origin_cls.n = member_cls.n = 0; |
542 | origin_cls.msgs_expected = member_cls.msgs_expected = 1; | 546 | origin_cls.msgs_expected = member_cls.msgs_expected = tmit->data_count; |
543 | 547 | ||
544 | GNUNET_MULTICAST_origin_to_all (origin, 1, 1, tmit_notify, tmit); | 548 | tmit->orig_tmit = GNUNET_MULTICAST_origin_to_all (origin, 1, 1, |
549 | tmit_notify, tmit); | ||
545 | } | 550 | } |
546 | 551 | ||
547 | 552 | ||