aboutsummaryrefslogtreecommitdiff
path: root/src/core/test_core_quota_compliance.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-07-08 18:19:52 +0000
committerChristian Grothoff <christian@grothoff.org>2016-07-08 18:19:52 +0000
commitb2bdeca1c78a40abb2f2295c48a31f92e6e32ec0 (patch)
tree5324cedba75f6598234d260621b01bc96579b5d2 /src/core/test_core_quota_compliance.c
parentc32824526668948c5555f95ef545733004cc5e4a (diff)
downloadgnunet-b2bdeca1c78a40abb2f2295c48a31f92e6e32ec0.tar.gz
gnunet-b2bdeca1c78a40abb2f2295c48a31f92e6e32ec0.zip
-fix cancellations in test
Diffstat (limited to 'src/core/test_core_quota_compliance.c')
-rw-r--r--src/core/test_core_quota_compliance.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c
index c30a4fec8..a0c456cef 100644
--- a/src/core/test_core_quota_compliance.c
+++ b/src/core/test_core_quota_compliance.c
@@ -541,6 +541,15 @@ init_notify (void *cls,
541 541
542 542
543static void 543static void
544offer_hello_done (void *cls)
545{
546 struct PeerContext *p = cls;
547
548 p->oh = NULL;
549}
550
551
552static void
544process_hello (void *cls, const struct GNUNET_MessageHeader *message) 553process_hello (void *cls, const struct GNUNET_MessageHeader *message)
545{ 554{
546 struct PeerContext *p = cls; 555 struct PeerContext *p = cls;
@@ -551,18 +560,28 @@ process_hello (void *cls, const struct GNUNET_MessageHeader *message)
551 p->hello = GNUNET_malloc (ntohs (message->size)); 560 p->hello = GNUNET_malloc (ntohs (message->size));
552 GNUNET_memcpy (p->hello, message, ntohs (message->size)); 561 GNUNET_memcpy (p->hello, message, ntohs (message->size));
553 if ((p == &p1) && (NULL == p2.oh)) 562 if ((p == &p1) && (NULL == p2.oh))
554 p2.oh = GNUNET_TRANSPORT_offer_hello (p2.cfg, message, NULL, NULL); 563 p2.oh = GNUNET_TRANSPORT_offer_hello (p2.cfg,
564 message,
565 &offer_hello_done,
566 &p2);
555 if ((p == &p2) && (NULL == p1.oh)) 567 if ((p == &p2) && (NULL == p1.oh))
556 p1.oh = GNUNET_TRANSPORT_offer_hello (p1.cfg, message, NULL, NULL); 568 p1.oh = GNUNET_TRANSPORT_offer_hello (p1.cfg, message,
569 &offer_hello_done,
570 &p1);
557 571
558 if ((p == &p1) && (p2.hello != NULL) && (NULL == p1.oh)) 572 if ((p == &p1) && (p2.hello != NULL) && (NULL == p1.oh))
559 p1.oh = GNUNET_TRANSPORT_offer_hello (p1.cfg, p2.hello, NULL, NULL); 573 p1.oh = GNUNET_TRANSPORT_offer_hello (p1.cfg,
574 p2.hello,
575 &offer_hello_done,
576 &p1);
560 if ((p == &p2) && (p1.hello != NULL) && (NULL == p2.oh) ) 577 if ((p == &p2) && (p1.hello != NULL) && (NULL == p2.oh) )
561 p2.oh = GNUNET_TRANSPORT_offer_hello (p2.cfg, p1.hello, NULL, NULL); 578 p2.oh = GNUNET_TRANSPORT_offer_hello (p2.cfg,
579 p1.hello,
580 &offer_hello_done,
581 &p2);
562} 582}
563 583
564 584
565
566static void 585static void
567setup_peer (struct PeerContext *p, const char *cfgname) 586setup_peer (struct PeerContext *p, const char *cfgname)
568{ 587{