diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-11-14 14:14:44 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-11-14 14:14:44 +0000 |
commit | e13724a1e59e7d4f896a8c6d624edd54f15aa99e (patch) | |
tree | 9d1c84dd2e46f037a5c79bedbd9b16238763c786 | |
parent | 0b911f6f0cb0159a97509b37ce0557942eac9ce9 (diff) | |
download | gnunet-e13724a1e59e7d4f896a8c6d624edd54f15aa99e.tar.gz gnunet-e13724a1e59e7d4f896a8c6d624edd54f15aa99e.zip |
- remove redundant transport handles
-rw-r--r-- | src/testbed/gnunet-service-testbed.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/testbed/gnunet-service-testbed.c b/src/testbed/gnunet-service-testbed.c index f336b12a7..1cce1bf42 100644 --- a/src/testbed/gnunet-service-testbed.c +++ b/src/testbed/gnunet-service-testbed.c | |||
@@ -558,11 +558,6 @@ struct OverlayConnectContext | |||
558 | struct GNUNET_TRANSPORT_Handle *p1th; | 558 | struct GNUNET_TRANSPORT_Handle *p1th; |
559 | 559 | ||
560 | /** | 560 | /** |
561 | * Transport handle of other peer to offer first peer's HELLO | ||
562 | */ | ||
563 | struct GNUNET_TRANSPORT_Handle *p2th; | ||
564 | |||
565 | /** | ||
566 | * Core handles of the first peer; used to notify when second peer connects to it | 561 | * Core handles of the first peer; used to notify when second peer connects to it |
567 | */ | 562 | */ |
568 | struct GNUNET_CORE_Handle *ch; | 563 | struct GNUNET_CORE_Handle *ch; |
@@ -2547,7 +2542,7 @@ handle_peer_destroy (void *cls, struct GNUNET_SERVER_Client *client, | |||
2547 | if (0 == peer->reference_cnt) | 2542 | if (0 == peer->reference_cnt) |
2548 | destroy_peer (peer); | 2543 | destroy_peer (peer); |
2549 | else | 2544 | else |
2550 | LOG (GNUNET_ERROR_TYPE_WARNING, | 2545 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2551 | "Delaying peer destroy as peer is currently in use\n"); | 2546 | "Delaying peer destroy as peer is currently in use\n"); |
2552 | send_operation_success_msg (client, GNUNET_ntohll (msg->operation_id)); | 2547 | send_operation_success_msg (client, GNUNET_ntohll (msg->operation_id)); |
2553 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 2548 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
@@ -2799,9 +2794,9 @@ cleanup_occ (struct OverlayConnectContext *occ) | |||
2799 | GNUNET_TRANSPORT_disconnect (occ->p1th); | 2794 | GNUNET_TRANSPORT_disconnect (occ->p1th); |
2800 | occ->peer->reference_cnt--; | 2795 | occ->peer->reference_cnt--; |
2801 | } | 2796 | } |
2802 | if (NULL != occ->p2th) | 2797 | if (NULL != occ->tcc.th) |
2803 | { | 2798 | { |
2804 | GNUNET_TRANSPORT_disconnect (occ->p2th); | 2799 | GNUNET_TRANSPORT_disconnect (occ->tcc.th); |
2805 | peer_list[occ->other_peer_id]->reference_cnt--; | 2800 | peer_list[occ->other_peer_id]->reference_cnt--; |
2806 | } | 2801 | } |
2807 | if ((GNUNET_YES == occ->peer->destroy_flag) | 2802 | if ((GNUNET_YES == occ->peer->destroy_flag) |
@@ -2904,10 +2899,10 @@ overlay_connect_notify (void *cls, const struct GNUNET_PeerIdentity *new_peer, | |||
2904 | occ->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 2899 | occ->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
2905 | GNUNET_free_non_null (occ->emsg); | 2900 | GNUNET_free_non_null (occ->emsg); |
2906 | occ->emsg = NULL; | 2901 | occ->emsg = NULL; |
2907 | if (NULL != occ->p2th) | 2902 | if (NULL != occ->tcc.th) |
2908 | { | 2903 | { |
2909 | GNUNET_TRANSPORT_disconnect (occ->p2th); | 2904 | GNUNET_TRANSPORT_disconnect (occ->tcc.th); |
2910 | occ->p2th = NULL; | 2905 | occ->tcc.th = NULL; |
2911 | peer_list[occ->other_peer_id]->reference_cnt--; | 2906 | peer_list[occ->other_peer_id]->reference_cnt--; |
2912 | } | 2907 | } |
2913 | LOG_DEBUG ("Peers connected - Sending overlay connect success\n"); | 2908 | LOG_DEBUG ("Peers connected - Sending overlay connect success\n"); |
@@ -3015,7 +3010,6 @@ occ_hello_sent_cb (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
3015 | GNUNET_free_non_null (occ->emsg); | 3010 | GNUNET_free_non_null (occ->emsg); |
3016 | occ->emsg = GNUNET_strdup ("Timeout while try connect\n"); | 3011 | occ->emsg = GNUNET_strdup ("Timeout while try connect\n"); |
3017 | occ->tcc.pid = &occ->peer_identity; | 3012 | occ->tcc.pid = &occ->peer_identity; |
3018 | occ->tcc.th = occ->p2th; | ||
3019 | occ->tcc.task = GNUNET_SCHEDULER_add_now (&try_connect_task, &occ->tcc); | 3013 | occ->tcc.task = GNUNET_SCHEDULER_add_now (&try_connect_task, &occ->tcc); |
3020 | } | 3014 | } |
3021 | 3015 | ||
@@ -3062,7 +3056,7 @@ send_hello (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
3062 | { | 3056 | { |
3063 | LOG_DEBUG ("Offering HELLO of %s to %s\n", | 3057 | LOG_DEBUG ("Offering HELLO of %s to %s\n", |
3064 | GNUNET_i2s (&occ->peer_identity), other_peer_str); | 3058 | GNUNET_i2s (&occ->peer_identity), other_peer_str); |
3065 | occ->ohh = GNUNET_TRANSPORT_offer_hello (occ->p2th, | 3059 | occ->ohh = GNUNET_TRANSPORT_offer_hello (occ->tcc.th, |
3066 | occ->hello, | 3060 | occ->hello, |
3067 | occ_hello_sent_cb, | 3061 | occ_hello_sent_cb, |
3068 | occ); | 3062 | occ); |
@@ -3136,11 +3130,11 @@ hello_update_cb (void *cls, const struct GNUNET_MessageHeader *hello) | |||
3136 | if (NULL == occ->peer2_controller) | 3130 | if (NULL == occ->peer2_controller) |
3137 | { | 3131 | { |
3138 | peer_list[occ->other_peer_id]->reference_cnt++; | 3132 | peer_list[occ->other_peer_id]->reference_cnt++; |
3139 | occ->p2th = | 3133 | occ->tcc.th = |
3140 | GNUNET_TRANSPORT_connect (peer_list[occ->other_peer_id]->details.local.cfg, | 3134 | GNUNET_TRANSPORT_connect (peer_list[occ->other_peer_id]->details.local.cfg, |
3141 | &occ->other_peer_identity, NULL, NULL, NULL, | 3135 | &occ->other_peer_identity, NULL, NULL, NULL, |
3142 | NULL); | 3136 | NULL); |
3143 | if (NULL == occ->p2th) | 3137 | if (NULL == occ->tcc.th) |
3144 | { | 3138 | { |
3145 | GNUNET_asprintf (&occ->emsg, "Cannot connect to TRANSPORT of %s\n", | 3139 | GNUNET_asprintf (&occ->emsg, "Cannot connect to TRANSPORT of %s\n", |
3146 | GNUNET_i2s (&occ->other_peer_identity)); | 3140 | GNUNET_i2s (&occ->other_peer_identity)); |