From f39c4e7141b1fbb4830cb24ff630a879337f98d4 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 5 Oct 2011 13:23:00 +0000 Subject: tell transport to connect, not core --- src/testing/testing.c | 43 +++++-------------------------------------- src/testing/testing_group.c | 7 ++----- 2 files changed, 7 insertions(+), 43 deletions(-) (limited to 'src/testing') diff --git a/src/testing/testing.c b/src/testing/testing.c index 2e1dceb68..8b080d800 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c @@ -1745,11 +1745,6 @@ struct GNUNET_TESTING_ConnectContext */ struct GNUNET_TESTING_Daemon *d2; - /** - * Handler for the request to core to connect to this peer. - */ - struct GNUNET_CORE_PeerRequestHandle *connect_request_handle; - /** * Transport handle to the first daemon (to offer the HELLO of the second daemon to). */ @@ -1835,12 +1830,6 @@ notify_connect_result (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) ctx->hello_send_task = GNUNET_SCHEDULER_NO_TASK; } - if (ctx->connect_request_handle != NULL) - { - GNUNET_CORE_peer_request_connect_cancel (ctx->connect_request_handle); - ctx->connect_request_handle = NULL; - } - if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) { if (ctx->d1th != NULL) @@ -1919,19 +1908,6 @@ connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer, ctx->timeout_task = GNUNET_SCHEDULER_add_now (¬ify_connect_result, ctx); } -/** - * Task called once a core connect request has been transmitted. - * - * @param cls struct GNUNET_TESTING_ConnectContext - * @param success was the request successful? - */ -void -core_connect_request_cont (void *cls, int success) -{ - struct GNUNET_TESTING_ConnectContext *ctx = cls; - - ctx->connect_request_handle = NULL; -} static void send_hello (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) @@ -1954,10 +1930,7 @@ send_hello (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) #endif GNUNET_TRANSPORT_offer_hello (ctx->d1th, hello, NULL, NULL); GNUNET_assert (ctx->d1core != NULL); - ctx->connect_request_handle = - GNUNET_CORE_peer_request_connect (ctx->d1core, &ctx->d2->id, - &core_connect_request_cont, ctx); - + GNUNET_TRANSPORT_try_connect (ctx->d1th, &ctx->d2->id); #if DEBUG_TESTING GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Sending connect request to CORE of %s for peer %s\n", @@ -1993,15 +1966,11 @@ core_init_notify (void *cls, struct GNUNET_CORE_Handle *server, if (connect_ctx->send_hello == GNUNET_NO) { - connect_ctx->connect_request_handle = - GNUNET_CORE_peer_request_connect (connect_ctx->d1core, - &connect_ctx->d2->id, - &core_connect_request_cont, - connect_ctx); - GNUNET_assert (connect_ctx->connect_request_handle != NULL); + GNUNET_TRANSPORT_try_connect (connect_ctx->d1th, + &connect_ctx->d2->id); #if DEBUG_TESTING GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Sending connect request to CORE of %s for peer %s\n", + "Sending connect request to TRANSPORT of %s for peer %s\n", connect_ctx->d1->shortname, connect_ctx->d2->shortname); #endif } @@ -2098,9 +2067,7 @@ reattempt_daemons_connect (void *cls, } else { - ctx->connect_request_handle = - GNUNET_CORE_peer_request_connect (ctx->d1core, &ctx->d2->id, - &core_connect_request_cont, ctx); + GNUNET_TRANSPORT_try_connect (ctx->d1th, &ctx->d2->id); } ctx->timeout_task = GNUNET_SCHEDULER_add_delayed (ctx->relative_timeout, diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c index f4d789ca9..3f31c6e1a 100644 --- a/src/testing/testing_group.c +++ b/src/testing/testing_group.c @@ -3347,11 +3347,8 @@ send_core_connect_requests (void *cls, conn = send_hello_context->peer->connect_peers_head; while (conn != NULL) { - GNUNET_CORE_peer_request_connect (send_hello_context->peer-> - daemon->server, - &send_hello_context->pg-> - peers[conn->index].daemon->id, NULL, - NULL); + GNUNET_TRANSPORT_try_connect (send_hello_context->peer->daemon->th, + &send_hello_context->pg->peers[conn->index].daemon->id); conn = conn->next; } send_hello_context->core_connect_task = -- cgit v1.2.3