diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-05-16 13:10:30 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-05-16 13:10:30 +0000 |
commit | 1354878e0763fa728d9e75b3676da35d82d55fb8 (patch) | |
tree | 85ac3f21c99036b945013288538bfee2c3220e44 /src | |
parent | 39963bb835382e3de74f82d671afa4213b703fdc (diff) | |
download | gnunet-1354878e0763fa728d9e75b3676da35d82d55fb8.tar.gz gnunet-1354878e0763fa728d9e75b3676da35d82d55fb8.zip |
- fix filtering through event mask
Diffstat (limited to 'src')
-rw-r--r-- | src/testbed/testbed_api.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c index 80f940467..93bdb03e5 100644 --- a/src/testbed/testbed_api.c +++ b/src/testbed/testbed_api.c | |||
@@ -559,6 +559,7 @@ handle_peer_event (struct GNUNET_TESTBED_Controller *c, | |||
559 | void *pcc_cls; | 559 | void *pcc_cls; |
560 | struct GNUNET_TESTBED_EventInformation event; | 560 | struct GNUNET_TESTBED_EventInformation event; |
561 | uint64_t op_id; | 561 | uint64_t op_id; |
562 | uint64_t mask; | ||
562 | 563 | ||
563 | GNUNET_assert (sizeof (struct GNUNET_TESTBED_PeerEventMessage) == | 564 | GNUNET_assert (sizeof (struct GNUNET_TESTBED_PeerEventMessage) == |
564 | ntohs (msg->header.size)); | 565 | ntohs (msg->header.size)); |
@@ -602,9 +603,9 @@ handle_peer_event (struct GNUNET_TESTBED_Controller *c, | |||
602 | GNUNET_TESTBED_remove_opc_ (opc->c, opc); | 603 | GNUNET_TESTBED_remove_opc_ (opc->c, opc); |
603 | opc->state = OPC_STATE_FINISHED; | 604 | opc->state = OPC_STATE_FINISHED; |
604 | exop_insert (event.op); | 605 | exop_insert (event.op); |
605 | if (0 != | 606 | mask = 1LL << GNUNET_TESTBED_ET_PEER_START; |
606 | ((GNUNET_TESTBED_ET_PEER_START | GNUNET_TESTBED_ET_PEER_STOP) & | 607 | mask |= 1LL << GNUNET_TESTBED_ET_PEER_STOP; |
607 | c->event_mask)) | 608 | if (0 != (mask & c->event_mask)) |
608 | { | 609 | { |
609 | if (NULL != c->cc) | 610 | if (NULL != c->cc) |
610 | c->cc (c->cc_cls, &event); | 611 | c->cc (c->cc_cls, &event); |
@@ -638,6 +639,7 @@ handle_peer_conevent (struct GNUNET_TESTBED_Controller *c, | |||
638 | void *cb_cls; | 639 | void *cb_cls; |
639 | struct GNUNET_TESTBED_EventInformation event; | 640 | struct GNUNET_TESTBED_EventInformation event; |
640 | uint64_t op_id; | 641 | uint64_t op_id; |
642 | uint64_t mask; | ||
641 | 643 | ||
642 | op_id = GNUNET_ntohll (msg->operation_id); | 644 | op_id = GNUNET_ntohll (msg->operation_id); |
643 | if (NULL == (opc = find_opc (c, op_id))) | 645 | if (NULL == (opc = find_opc (c, op_id))) |
@@ -676,9 +678,9 @@ handle_peer_conevent (struct GNUNET_TESTBED_Controller *c, | |||
676 | GNUNET_TESTBED_remove_opc_ (opc->c, opc); | 678 | GNUNET_TESTBED_remove_opc_ (opc->c, opc); |
677 | opc->state = OPC_STATE_FINISHED; | 679 | opc->state = OPC_STATE_FINISHED; |
678 | exop_insert (event.op); | 680 | exop_insert (event.op); |
679 | if (0 != | 681 | mask = 1LL << GNUNET_TESTBED_ET_CONNECT; |
680 | ((GNUNET_TESTBED_ET_CONNECT | GNUNET_TESTBED_ET_DISCONNECT) & | 682 | mask |= 1LL << GNUNET_TESTBED_ET_DISCONNECT; |
681 | c->event_mask)) | 683 | if (0 != (mask & c->event_mask)) |
682 | { | 684 | { |
683 | if (NULL != c->cc) | 685 | if (NULL != c->cc) |
684 | c->cc (c->cc_cls, &event); | 686 | c->cc (c->cc_cls, &event); |
@@ -940,6 +942,7 @@ handle_slave_config (struct GNUNET_TESTBED_Controller *c, | |||
940 | { | 942 | { |
941 | struct OperationContext *opc; | 943 | struct OperationContext *opc; |
942 | uint64_t op_id; | 944 | uint64_t op_id; |
945 | uint64_t mask; | ||
943 | struct GNUNET_TESTBED_EventInformation event; | 946 | struct GNUNET_TESTBED_EventInformation event; |
944 | 947 | ||
945 | op_id = GNUNET_ntohll (msg->operation_id); | 948 | op_id = GNUNET_ntohll (msg->operation_id); |
@@ -955,7 +958,8 @@ handle_slave_config (struct GNUNET_TESTBED_Controller *c, | |||
955 | } | 958 | } |
956 | opc->state = OPC_STATE_FINISHED; | 959 | opc->state = OPC_STATE_FINISHED; |
957 | GNUNET_TESTBED_remove_opc_ (opc->c, opc); | 960 | GNUNET_TESTBED_remove_opc_ (opc->c, opc); |
958 | if ((0 != (GNUNET_TESTBED_ET_OPERATION_FINISHED & c->event_mask)) && | 961 | mask = 1LL << GNUNET_TESTBED_ET_OPERATION_FINISHED; |
962 | if ((0 != (mask & c->event_mask)) && | ||
959 | (NULL != c->cc)) | 963 | (NULL != c->cc)) |
960 | { | 964 | { |
961 | opc->data = GNUNET_TESTBED_extract_config_ (&msg->header); | 965 | opc->data = GNUNET_TESTBED_extract_config_ (&msg->header); |