diff options
Diffstat (limited to 'src/testbed/gnunet-service-testbed_oc.c')
-rw-r--r-- | src/testbed/gnunet-service-testbed_oc.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/testbed/gnunet-service-testbed_oc.c b/src/testbed/gnunet-service-testbed_oc.c index c2978728c..c331fb8f0 100644 --- a/src/testbed/gnunet-service-testbed_oc.c +++ b/src/testbed/gnunet-service-testbed_oc.c | |||
@@ -65,7 +65,7 @@ struct TryConnectContext | |||
65 | /** | 65 | /** |
66 | * The task handle | 66 | * The task handle |
67 | */ | 67 | */ |
68 | GNUNET_SCHEDULER_TaskIdentifier task; | 68 | struct GNUNET_SCHEDULER_Task * task; |
69 | 69 | ||
70 | /** | 70 | /** |
71 | * The id of the operation which is resposible for this context | 71 | * The id of the operation which is resposible for this context |
@@ -250,17 +250,17 @@ struct OverlayConnectContext | |||
250 | * The id of the task for sending HELLO of peer 2 to peer 1 and ask peer 1 to | 250 | * The id of the task for sending HELLO of peer 2 to peer 1 and ask peer 1 to |
251 | * connect to peer 2 | 251 | * connect to peer 2 |
252 | */ | 252 | */ |
253 | GNUNET_SCHEDULER_TaskIdentifier send_hello_task; | 253 | struct GNUNET_SCHEDULER_Task * send_hello_task; |
254 | 254 | ||
255 | /** | 255 | /** |
256 | * The id of the overlay connect timeout task | 256 | * The id of the overlay connect timeout task |
257 | */ | 257 | */ |
258 | GNUNET_SCHEDULER_TaskIdentifier timeout_task; | 258 | struct GNUNET_SCHEDULER_Task * timeout_task; |
259 | 259 | ||
260 | /** | 260 | /** |
261 | * The id of the cleanup task | 261 | * The id of the cleanup task |
262 | */ | 262 | */ |
263 | GNUNET_SCHEDULER_TaskIdentifier cleanup_task; | 263 | struct GNUNET_SCHEDULER_Task * cleanup_task; |
264 | 264 | ||
265 | /** | 265 | /** |
266 | * The type of this context information | 266 | * The type of this context information |
@@ -321,12 +321,12 @@ struct RemoteOverlayConnectCtx | |||
321 | /** | 321 | /** |
322 | * Task for offering HELLO of A to B and doing try_connect | 322 | * Task for offering HELLO of A to B and doing try_connect |
323 | */ | 323 | */ |
324 | GNUNET_SCHEDULER_TaskIdentifier attempt_connect_task_id; | 324 | struct GNUNET_SCHEDULER_Task * attempt_connect_task_id; |
325 | 325 | ||
326 | /** | 326 | /** |
327 | * Task to timeout RequestOverlayConnect | 327 | * Task to timeout RequestOverlayConnect |
328 | */ | 328 | */ |
329 | GNUNET_SCHEDULER_TaskIdentifier timeout_rocc_task_id; | 329 | struct GNUNET_SCHEDULER_Task * timeout_rocc_task_id; |
330 | 330 | ||
331 | /** | 331 | /** |
332 | * The id of the operation responsible for creating this context | 332 | * The id of the operation responsible for creating this context |
@@ -478,7 +478,7 @@ cleanup_occ_lp2c (struct LocalPeer2Context *lp2c) | |||
478 | GST_connection_pool_get_handle_done (lp2c->tcc.cgh_th); | 478 | GST_connection_pool_get_handle_done (lp2c->tcc.cgh_th); |
479 | if (NULL != lp2c->tcc.tch) | 479 | if (NULL != lp2c->tcc.tch) |
480 | GNUNET_TRANSPORT_try_connect_cancel (lp2c->tcc.tch); | 480 | GNUNET_TRANSPORT_try_connect_cancel (lp2c->tcc.tch); |
481 | if (GNUNET_SCHEDULER_NO_TASK != lp2c->tcc.task) | 481 | if (NULL != lp2c->tcc.task) |
482 | GNUNET_SCHEDULER_cancel (lp2c->tcc.task); | 482 | GNUNET_SCHEDULER_cancel (lp2c->tcc.task); |
483 | } | 483 | } |
484 | 484 | ||
@@ -523,11 +523,11 @@ cleanup_occ (struct OverlayConnectContext *occ) | |||
523 | GNUNET_free_non_null (occ->emsg); | 523 | GNUNET_free_non_null (occ->emsg); |
524 | GNUNET_free_non_null (occ->hello); | 524 | GNUNET_free_non_null (occ->hello); |
525 | GNUNET_SERVER_client_drop (occ->client); | 525 | GNUNET_SERVER_client_drop (occ->client); |
526 | if (GNUNET_SCHEDULER_NO_TASK != occ->send_hello_task) | 526 | if (NULL != occ->send_hello_task) |
527 | GNUNET_SCHEDULER_cancel (occ->send_hello_task); | 527 | GNUNET_SCHEDULER_cancel (occ->send_hello_task); |
528 | if (GNUNET_SCHEDULER_NO_TASK != occ->cleanup_task) | 528 | if (NULL != occ->cleanup_task) |
529 | GNUNET_SCHEDULER_cancel (occ->cleanup_task); | 529 | GNUNET_SCHEDULER_cancel (occ->cleanup_task); |
530 | if (GNUNET_SCHEDULER_NO_TASK != occ->timeout_task) | 530 | if (NULL != occ->timeout_task) |
531 | GNUNET_SCHEDULER_cancel (occ->timeout_task); | 531 | GNUNET_SCHEDULER_cancel (occ->timeout_task); |
532 | if (NULL != occ->cgh_ch) | 532 | if (NULL != occ->cgh_ch) |
533 | GST_connection_pool_get_handle_done (occ->cgh_ch); | 533 | GST_connection_pool_get_handle_done (occ->cgh_ch); |
@@ -571,7 +571,7 @@ do_cleanup_occ (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
571 | { | 571 | { |
572 | struct OverlayConnectContext *occ = cls; | 572 | struct OverlayConnectContext *occ = cls; |
573 | 573 | ||
574 | occ->cleanup_task = GNUNET_SCHEDULER_NO_TASK; | 574 | occ->cleanup_task = NULL; |
575 | cleanup_occ (occ); | 575 | cleanup_occ (occ); |
576 | } | 576 | } |
577 | 577 | ||
@@ -588,8 +588,8 @@ timeout_overlay_connect (void *cls, | |||
588 | { | 588 | { |
589 | struct OverlayConnectContext *occ = cls; | 589 | struct OverlayConnectContext *occ = cls; |
590 | 590 | ||
591 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != occ->timeout_task); | 591 | GNUNET_assert (NULL != occ->timeout_task); |
592 | occ->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 592 | occ->timeout_task = NULL; |
593 | /* LOG (GNUNET_ERROR_TYPE_WARNING, */ | 593 | /* LOG (GNUNET_ERROR_TYPE_WARNING, */ |
594 | /* "0x%llx: Timeout while connecting peers %u and %u: %s\n", occ->op_id, */ | 594 | /* "0x%llx: Timeout while connecting peers %u and %u: %s\n", occ->op_id, */ |
595 | /* occ->peer->id, occ->other_peer_id, occ->emsg); */ | 595 | /* occ->peer->id, occ->other_peer_id, occ->emsg); */ |
@@ -653,21 +653,21 @@ overlay_connect_notify (void *cls, const struct GNUNET_PeerIdentity *new_peer) | |||
653 | LOG_DEBUG ("0x%llx: Peer %4s connected to peer %4s\n", occ->op_id, | 653 | LOG_DEBUG ("0x%llx: Peer %4s connected to peer %4s\n", occ->op_id, |
654 | other_peer_str, GNUNET_i2s (&occ->peer_identity)); | 654 | other_peer_str, GNUNET_i2s (&occ->peer_identity)); |
655 | GNUNET_free (other_peer_str); | 655 | GNUNET_free (other_peer_str); |
656 | if (GNUNET_SCHEDULER_NO_TASK != occ->send_hello_task) | 656 | if (NULL != occ->send_hello_task) |
657 | { | 657 | { |
658 | GNUNET_SCHEDULER_cancel (occ->send_hello_task); | 658 | GNUNET_SCHEDULER_cancel (occ->send_hello_task); |
659 | occ->send_hello_task = GNUNET_SCHEDULER_NO_TASK; | 659 | occ->send_hello_task = NULL; |
660 | } | 660 | } |
661 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != occ->timeout_task); | 661 | GNUNET_assert (NULL != occ->timeout_task); |
662 | GNUNET_SCHEDULER_cancel (occ->timeout_task); | 662 | GNUNET_SCHEDULER_cancel (occ->timeout_task); |
663 | occ->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 663 | occ->timeout_task = NULL; |
664 | if (OCC_TYPE_LOCAL == occ->type) | 664 | if (OCC_TYPE_LOCAL == occ->type) |
665 | { | 665 | { |
666 | lp2c = &occ->p2ctx.local; | 666 | lp2c = &occ->p2ctx.local; |
667 | if (GNUNET_SCHEDULER_NO_TASK != lp2c->tcc.task) | 667 | if (NULL != lp2c->tcc.task) |
668 | { | 668 | { |
669 | GNUNET_SCHEDULER_cancel (lp2c->tcc.task); | 669 | GNUNET_SCHEDULER_cancel (lp2c->tcc.task); |
670 | lp2c->tcc.task = GNUNET_SCHEDULER_NO_TASK; | 670 | lp2c->tcc.task = NULL; |
671 | } | 671 | } |
672 | } | 672 | } |
673 | GNUNET_free_non_null (occ->emsg); | 673 | GNUNET_free_non_null (occ->emsg); |
@@ -700,7 +700,7 @@ try_connect_cb (void *cls, const int result) | |||
700 | struct TryConnectContext *tcc = cls; | 700 | struct TryConnectContext *tcc = cls; |
701 | 701 | ||
702 | tcc->tch = NULL; | 702 | tcc->tch = NULL; |
703 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == tcc->task); | 703 | GNUNET_assert (NULL == tcc->task); |
704 | tcc->task = | 704 | tcc->task = |
705 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply | 705 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply |
706 | (GNUNET_TIME_UNIT_MILLISECONDS, | 706 | (GNUNET_TIME_UNIT_MILLISECONDS, |
@@ -720,7 +720,7 @@ try_connect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
720 | { | 720 | { |
721 | struct TryConnectContext *tcc = cls; | 721 | struct TryConnectContext *tcc = cls; |
722 | 722 | ||
723 | tcc->task = GNUNET_SCHEDULER_NO_TASK; | 723 | tcc->task = NULL; |
724 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) | 724 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) |
725 | return; | 725 | return; |
726 | GNUNET_assert (NULL == tcc->tch); | 726 | GNUNET_assert (NULL == tcc->tch); |
@@ -762,7 +762,7 @@ occ_hello_sent_cb (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
762 | GNUNET_assert (OCC_TYPE_LOCAL == occ->type); | 762 | GNUNET_assert (OCC_TYPE_LOCAL == occ->type); |
763 | lp2c = &occ->p2ctx.local; | 763 | lp2c = &occ->p2ctx.local; |
764 | lp2c->ohh = NULL; | 764 | lp2c->ohh = NULL; |
765 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == occ->send_hello_task); | 765 | GNUNET_assert (NULL == occ->send_hello_task); |
766 | if (GNUNET_SCHEDULER_REASON_TIMEOUT == tc->reason) | 766 | if (GNUNET_SCHEDULER_REASON_TIMEOUT == tc->reason) |
767 | { | 767 | { |
768 | GNUNET_free_non_null (occ->emsg); | 768 | GNUNET_free_non_null (occ->emsg); |
@@ -839,7 +839,7 @@ send_hello (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
839 | struct LocalPeer2Context *lp2c; | 839 | struct LocalPeer2Context *lp2c; |
840 | char *other_peer_str; | 840 | char *other_peer_str; |
841 | 841 | ||
842 | occ->send_hello_task = GNUNET_SCHEDULER_NO_TASK; | 842 | occ->send_hello_task = NULL; |
843 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 843 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
844 | return; | 844 | return; |
845 | GNUNET_assert (NULL != occ->hello); | 845 | GNUNET_assert (NULL != occ->hello); |
@@ -1048,7 +1048,7 @@ occ_cache_get_handle_core_cb (void *cls, struct GNUNET_CORE_Handle *ch, | |||
1048 | struct OverlayConnectContext *occ = cls; | 1048 | struct OverlayConnectContext *occ = cls; |
1049 | const struct GNUNET_MessageHeader *hello; | 1049 | const struct GNUNET_MessageHeader *hello; |
1050 | 1050 | ||
1051 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != occ->timeout_task); | 1051 | GNUNET_assert (NULL != occ->timeout_task); |
1052 | GNUNET_free_non_null (occ->emsg); | 1052 | GNUNET_free_non_null (occ->emsg); |
1053 | if ((NULL == ch) || (NULL == my_identity)) | 1053 | if ((NULL == ch) || (NULL == my_identity)) |
1054 | { | 1054 | { |
@@ -1066,7 +1066,7 @@ occ_cache_get_handle_core_cb (void *cls, struct GNUNET_CORE_Handle *ch, | |||
1066 | { | 1066 | { |
1067 | LOG_DEBUG ("0x%llx: Target peer already connected\n", occ->op_id); | 1067 | LOG_DEBUG ("0x%llx: Target peer already connected\n", occ->op_id); |
1068 | GNUNET_SCHEDULER_cancel (occ->timeout_task); | 1068 | GNUNET_SCHEDULER_cancel (occ->timeout_task); |
1069 | occ->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 1069 | occ->timeout_task = NULL; |
1070 | send_overlay_connect_success_msg (occ); | 1070 | send_overlay_connect_success_msg (occ); |
1071 | occ->cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup_occ, occ); | 1071 | occ->cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup_occ, occ); |
1072 | return; | 1072 | return; |
@@ -1114,7 +1114,7 @@ overlay_connect_get_config (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1114 | GNUNET_assert (OCC_TYPE_LOCAL != occ->type); | 1114 | GNUNET_assert (OCC_TYPE_LOCAL != occ->type); |
1115 | rp2c = &occ->p2ctx.remote; | 1115 | rp2c = &occ->p2ctx.remote; |
1116 | rp2c->opc = NULL; | 1116 | rp2c->opc = NULL; |
1117 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != occ->timeout_task); | 1117 | GNUNET_assert (NULL != occ->timeout_task); |
1118 | if (GNUNET_MESSAGE_TYPE_TESTBED_PEER_INFORMATION != ntohs (msg->type)) | 1118 | if (GNUNET_MESSAGE_TYPE_TESTBED_PEER_INFORMATION != ntohs (msg->type)) |
1119 | { | 1119 | { |
1120 | GNUNET_SCHEDULER_cancel (occ->timeout_task); | 1120 | GNUNET_SCHEDULER_cancel (occ->timeout_task); |
@@ -1462,7 +1462,7 @@ GST_handle_overlay_connect (void *cls, struct GNUNET_SERVER_Client *client, | |||
1462 | GST_peer_list[p1]->reference_cnt++; | 1462 | GST_peer_list[p1]->reference_cnt++; |
1463 | occ->peer = GST_peer_list[p1]; | 1463 | occ->peer = GST_peer_list[p1]; |
1464 | occ->op_id = operation_id; | 1464 | occ->op_id = operation_id; |
1465 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == occ->timeout_task); | 1465 | GNUNET_assert (NULL == occ->timeout_task); |
1466 | occ->timeout_task = | 1466 | occ->timeout_task = |
1467 | GNUNET_SCHEDULER_add_delayed (GST_timeout, &timeout_overlay_connect, occ); | 1467 | GNUNET_SCHEDULER_add_delayed (GST_timeout, &timeout_overlay_connect, occ); |
1468 | switch (occ->type) | 1468 | switch (occ->type) |
@@ -1508,15 +1508,15 @@ static void | |||
1508 | cleanup_rocc (struct RemoteOverlayConnectCtx *rocc) | 1508 | cleanup_rocc (struct RemoteOverlayConnectCtx *rocc) |
1509 | { | 1509 | { |
1510 | LOG_DEBUG ("0x%llx: Cleaning up rocc\n", rocc->op_id); | 1510 | LOG_DEBUG ("0x%llx: Cleaning up rocc\n", rocc->op_id); |
1511 | if (GNUNET_SCHEDULER_NO_TASK != rocc->attempt_connect_task_id) | 1511 | if (NULL != rocc->attempt_connect_task_id) |
1512 | GNUNET_SCHEDULER_cancel (rocc->attempt_connect_task_id); | 1512 | GNUNET_SCHEDULER_cancel (rocc->attempt_connect_task_id); |
1513 | if (GNUNET_SCHEDULER_NO_TASK != rocc->timeout_rocc_task_id) | 1513 | if (NULL != rocc->timeout_rocc_task_id) |
1514 | GNUNET_SCHEDULER_cancel (rocc->timeout_rocc_task_id); | 1514 | GNUNET_SCHEDULER_cancel (rocc->timeout_rocc_task_id); |
1515 | if (NULL != rocc->ohh) | 1515 | if (NULL != rocc->ohh) |
1516 | GNUNET_TRANSPORT_offer_hello_cancel (rocc->ohh); | 1516 | GNUNET_TRANSPORT_offer_hello_cancel (rocc->ohh); |
1517 | if (NULL != rocc->tcc.tch) | 1517 | if (NULL != rocc->tcc.tch) |
1518 | GNUNET_TRANSPORT_try_connect_cancel (rocc->tcc.tch); | 1518 | GNUNET_TRANSPORT_try_connect_cancel (rocc->tcc.tch); |
1519 | if (GNUNET_SCHEDULER_NO_TASK != rocc->tcc.task) | 1519 | if (NULL != rocc->tcc.task) |
1520 | GNUNET_SCHEDULER_cancel (rocc->tcc.task); | 1520 | GNUNET_SCHEDULER_cancel (rocc->tcc.task); |
1521 | GST_connection_pool_get_handle_done (rocc->tcc.cgh_th); | 1521 | GST_connection_pool_get_handle_done (rocc->tcc.cgh_th); |
1522 | GNUNET_assert (rocc->peer->reference_cnt > 0); | 1522 | GNUNET_assert (rocc->peer->reference_cnt > 0); |
@@ -1541,8 +1541,8 @@ timeout_rocc_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1541 | { | 1541 | { |
1542 | struct RemoteOverlayConnectCtx *rocc = cls; | 1542 | struct RemoteOverlayConnectCtx *rocc = cls; |
1543 | 1543 | ||
1544 | GNUNET_assert (rocc->timeout_rocc_task_id != GNUNET_SCHEDULER_NO_TASK); | 1544 | GNUNET_assert (rocc->timeout_rocc_task_id != NULL); |
1545 | rocc->timeout_rocc_task_id = GNUNET_SCHEDULER_NO_TASK; | 1545 | rocc->timeout_rocc_task_id = NULL; |
1546 | LOG_DEBUG ("0x%llx: rocc timed out\n", rocc->op_id); | 1546 | LOG_DEBUG ("0x%llx: rocc timed out\n", rocc->op_id); |
1547 | cleanup_rocc (rocc); | 1547 | cleanup_rocc (rocc); |
1548 | } | 1548 | } |
@@ -1596,7 +1596,7 @@ rocc_hello_sent_cb (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1596 | struct RemoteOverlayConnectCtx *rocc = cls; | 1596 | struct RemoteOverlayConnectCtx *rocc = cls; |
1597 | 1597 | ||
1598 | rocc->ohh = NULL; | 1598 | rocc->ohh = NULL; |
1599 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == rocc->attempt_connect_task_id); | 1599 | GNUNET_assert (NULL == rocc->attempt_connect_task_id); |
1600 | LOG_DEBUG ("0x%llx: HELLO of peer %4s sent to local peer with id: %u\n", | 1600 | LOG_DEBUG ("0x%llx: HELLO of peer %4s sent to local peer with id: %u\n", |
1601 | rocc->op_id, GNUNET_i2s (&rocc->a_id), rocc->peer->id); | 1601 | rocc->op_id, GNUNET_i2s (&rocc->a_id), rocc->peer->id); |
1602 | if (GNUNET_SCHEDULER_REASON_TIMEOUT == tc->reason) | 1602 | if (GNUNET_SCHEDULER_REASON_TIMEOUT == tc->reason) |
@@ -1627,8 +1627,8 @@ attempt_connect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1627 | { | 1627 | { |
1628 | struct RemoteOverlayConnectCtx *rocc = cls; | 1628 | struct RemoteOverlayConnectCtx *rocc = cls; |
1629 | 1629 | ||
1630 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != rocc->attempt_connect_task_id); | 1630 | GNUNET_assert (NULL != rocc->attempt_connect_task_id); |
1631 | rocc->attempt_connect_task_id = GNUNET_SCHEDULER_NO_TASK; | 1631 | rocc->attempt_connect_task_id = NULL; |
1632 | LOG_DEBUG ("0x%llx: Offering HELLO of peer %4s to local peer with id: %u\n", | 1632 | LOG_DEBUG ("0x%llx: Offering HELLO of peer %4s to local peer with id: %u\n", |
1633 | rocc->op_id, GNUNET_i2s (&rocc->a_id), rocc->peer->id); | 1633 | rocc->op_id, GNUNET_i2s (&rocc->a_id), rocc->peer->id); |
1634 | rocc->ohh = | 1634 | rocc->ohh = |