diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-10-29 13:09:29 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-10-29 13:09:29 +0000 |
commit | 5a1dc6f2e3f8a112651c8d5aecf0e0a45f53f97e (patch) | |
tree | 1a66c0beaa96c08a3737999de3de81d18f76e819 /src/testbed/gnunet-service-testbed_oc.c | |
parent | cab0c93eeab52464c004bc63ee7e8f39fb712dd7 (diff) | |
download | gnunet-5a1dc6f2e3f8a112651c8d5aecf0e0a45f53f97e.tar.gz gnunet-5a1dc6f2e3f8a112651c8d5aecf0e0a45f53f97e.zip |
fixing #4035
Diffstat (limited to 'src/testbed/gnunet-service-testbed_oc.c')
-rw-r--r-- | src/testbed/gnunet-service-testbed_oc.c | 52 |
1 files changed, 47 insertions, 5 deletions
diff --git a/src/testbed/gnunet-service-testbed_oc.c b/src/testbed/gnunet-service-testbed_oc.c index ff5331fe4..d70d466c0 100644 --- a/src/testbed/gnunet-service-testbed_oc.c +++ b/src/testbed/gnunet-service-testbed_oc.c | |||
@@ -460,11 +460,25 @@ static void | |||
460 | cleanup_occ_lp2c (struct LocalPeer2Context *lp2c) | 460 | cleanup_occ_lp2c (struct LocalPeer2Context *lp2c) |
461 | { | 461 | { |
462 | if (NULL != lp2c->ohh) | 462 | if (NULL != lp2c->ohh) |
463 | { | ||
463 | GNUNET_TRANSPORT_offer_hello_cancel (lp2c->ohh); | 464 | GNUNET_TRANSPORT_offer_hello_cancel (lp2c->ohh); |
464 | GST_connection_pool_get_handle_done (lp2c->tcc.cgh_p2_th); | 465 | lp2c->ohh = NULL; |
465 | GST_connection_pool_get_handle_done (lp2c->tcc.cgh_p2_ats); | 466 | } |
467 | if (NULL != lp2c->tcc.cgh_p2_th) | ||
468 | { | ||
469 | GST_connection_pool_get_handle_done (lp2c->tcc.cgh_p2_th); | ||
470 | lp2c->tcc.cgh_p2_th = NULL; | ||
471 | } | ||
472 | if (NULL != lp2c->tcc.cgh_p2_ats) | ||
473 | { | ||
474 | GST_connection_pool_get_handle_done (lp2c->tcc.cgh_p2_ats); | ||
475 | lp2c->tcc.cgh_p2_ats = NULL; | ||
476 | } | ||
466 | if (NULL != lp2c->tcc.csh) | 477 | if (NULL != lp2c->tcc.csh) |
478 | { | ||
467 | GNUNET_ATS_connectivity_suggest_cancel (lp2c->tcc.csh); | 479 | GNUNET_ATS_connectivity_suggest_cancel (lp2c->tcc.csh); |
480 | lp2c->tcc.csh = NULL; | ||
481 | } | ||
468 | } | 482 | } |
469 | 483 | ||
470 | 484 | ||
@@ -478,11 +492,20 @@ static void | |||
478 | cleanup_occ_rp2c (struct RemotePeer2Context *rp2c) | 492 | cleanup_occ_rp2c (struct RemotePeer2Context *rp2c) |
479 | { | 493 | { |
480 | if (NULL != rp2c->opc) | 494 | if (NULL != rp2c->opc) |
495 | { | ||
481 | GNUNET_TESTBED_forward_operation_msg_cancel_ (rp2c->opc); | 496 | GNUNET_TESTBED_forward_operation_msg_cancel_ (rp2c->opc); |
497 | rp2c->opc = NULL; | ||
498 | } | ||
482 | if (NULL != rp2c->ncn) | 499 | if (NULL != rp2c->ncn) |
500 | { | ||
483 | GST_neighbour_get_connection_cancel (rp2c->ncn); | 501 | GST_neighbour_get_connection_cancel (rp2c->ncn); |
502 | rp2c->ncn = NULL; | ||
503 | } | ||
484 | if ( (NULL != rp2c->p2c) && (NULL != rp2c->p2n) ) | 504 | if ( (NULL != rp2c->p2c) && (NULL != rp2c->p2n) ) |
505 | { | ||
485 | GST_neighbour_release_connection (rp2c->p2n); | 506 | GST_neighbour_release_connection (rp2c->p2n); |
507 | rp2c->p2n = NULL; | ||
508 | } | ||
486 | } | 509 | } |
487 | 510 | ||
488 | /** | 511 | /** |
@@ -503,7 +526,8 @@ cleanup_occ (struct OverlayConnectContext *occ) | |||
503 | { | 526 | { |
504 | struct Peer *peer2; | 527 | struct Peer *peer2; |
505 | 528 | ||
506 | LOG_DEBUG ("0x%llx: Cleaning up occ\n", occ->op_id); | 529 | LOG_DEBUG ("0x%llx: Cleaning up occ\n", |
530 | occ->op_id); | ||
507 | GNUNET_free_non_null (occ->emsg); | 531 | GNUNET_free_non_null (occ->emsg); |
508 | GNUNET_free_non_null (occ->hello); | 532 | GNUNET_free_non_null (occ->hello); |
509 | GNUNET_SERVER_client_drop (occ->client); | 533 | GNUNET_SERVER_client_drop (occ->client); |
@@ -579,11 +603,16 @@ timeout_overlay_connect (void *cls, | |||
579 | /* LOG (GNUNET_ERROR_TYPE_WARNING, */ | 603 | /* LOG (GNUNET_ERROR_TYPE_WARNING, */ |
580 | /* "0x%llx: Timeout while connecting peers %u and %u: %s\n", occ->op_id, */ | 604 | /* "0x%llx: Timeout while connecting peers %u and %u: %s\n", occ->op_id, */ |
581 | /* occ->peer->id, occ->other_peer_id, occ->emsg); */ | 605 | /* occ->peer->id, occ->other_peer_id, occ->emsg); */ |
582 | GST_send_operation_fail_msg (occ->client, occ->op_id, occ->emsg); | 606 | GST_send_operation_fail_msg (occ->client, |
607 | occ->op_id, | ||
608 | occ->emsg); | ||
583 | cleanup_occ (occ); | 609 | cleanup_occ (occ); |
584 | } | 610 | } |
585 | 611 | ||
586 | 612 | ||
613 | /** | ||
614 | * FIXME. | ||
615 | */ | ||
587 | static void | 616 | static void |
588 | send_overlay_connect_success_msg (struct OverlayConnectContext *occ) | 617 | send_overlay_connect_success_msg (struct OverlayConnectContext *occ) |
589 | { | 618 | { |
@@ -651,10 +680,21 @@ overlay_connect_notify (void *cls, | |||
651 | GNUNET_assert (NULL != occ->timeout_task); | 680 | GNUNET_assert (NULL != occ->timeout_task); |
652 | GNUNET_SCHEDULER_cancel (occ->timeout_task); | 681 | GNUNET_SCHEDULER_cancel (occ->timeout_task); |
653 | occ->timeout_task = NULL; | 682 | occ->timeout_task = NULL; |
683 | switch (occ->type) | ||
684 | { | ||
685 | case OCC_TYPE_LOCAL: | ||
686 | cleanup_occ_lp2c (&occ->p2ctx.local); | ||
687 | break; | ||
688 | case OCC_TYPE_REMOTE_SLAVE: | ||
689 | case OCC_TYPE_REMOTE_LATERAL: | ||
690 | cleanup_occ_rp2c (&occ->p2ctx.remote); | ||
691 | break; | ||
692 | } | ||
654 | GNUNET_free_non_null (occ->emsg); | 693 | GNUNET_free_non_null (occ->emsg); |
655 | occ->emsg = NULL; | 694 | occ->emsg = NULL; |
656 | send_overlay_connect_success_msg (occ); | 695 | send_overlay_connect_success_msg (occ); |
657 | occ->cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup_occ, occ); | 696 | occ->cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup_occ, |
697 | occ); | ||
658 | } | 698 | } |
659 | 699 | ||
660 | 700 | ||
@@ -761,6 +801,7 @@ occ_hello_sent_cb (void *cls, | |||
761 | struct Peer *peer2; | 801 | struct Peer *peer2; |
762 | 802 | ||
763 | GNUNET_assert (OCC_TYPE_LOCAL == occ->type); | 803 | GNUNET_assert (OCC_TYPE_LOCAL == occ->type); |
804 | GNUNET_assert (NULL != occ->timeout_task); | ||
764 | lp2c = &occ->p2ctx.local; | 805 | lp2c = &occ->p2ctx.local; |
765 | lp2c->ohh = NULL; | 806 | lp2c->ohh = NULL; |
766 | 807 | ||
@@ -851,6 +892,7 @@ send_hello (void *cls, | |||
851 | char *other_peer_str; | 892 | char *other_peer_str; |
852 | 893 | ||
853 | occ->send_hello_task = NULL; | 894 | occ->send_hello_task = NULL; |
895 | GNUNET_assert (NULL != occ->timeout_task); | ||
854 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 896 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
855 | return; | 897 | return; |
856 | GNUNET_assert (NULL != occ->hello); | 898 | GNUNET_assert (NULL != occ->hello); |