diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-10-05 13:23:00 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-10-05 13:23:00 +0000 |
commit | f39c4e7141b1fbb4830cb24ff630a879337f98d4 (patch) | |
tree | 77d90b29d080dbd3077a2c1371247294c11939ed /src/testing | |
parent | 1fb197c7605c2a8a28cd83d67ccd28af089c7f84 (diff) | |
download | gnunet-f39c4e7141b1fbb4830cb24ff630a879337f98d4.tar.gz gnunet-f39c4e7141b1fbb4830cb24ff630a879337f98d4.zip |
tell transport to connect, not core
Diffstat (limited to 'src/testing')
-rw-r--r-- | src/testing/testing.c | 43 | ||||
-rw-r--r-- | src/testing/testing_group.c | 7 |
2 files changed, 7 insertions, 43 deletions
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 | |||
@@ -1746,11 +1746,6 @@ struct GNUNET_TESTING_ConnectContext | |||
1746 | struct GNUNET_TESTING_Daemon *d2; | 1746 | struct GNUNET_TESTING_Daemon *d2; |
1747 | 1747 | ||
1748 | /** | 1748 | /** |
1749 | * Handler for the request to core to connect to this peer. | ||
1750 | */ | ||
1751 | struct GNUNET_CORE_PeerRequestHandle *connect_request_handle; | ||
1752 | |||
1753 | /** | ||
1754 | * Transport handle to the first daemon (to offer the HELLO of the second daemon to). | 1749 | * Transport handle to the first daemon (to offer the HELLO of the second daemon to). |
1755 | */ | 1750 | */ |
1756 | struct GNUNET_TRANSPORT_Handle *d1th; | 1751 | struct GNUNET_TRANSPORT_Handle *d1th; |
@@ -1835,12 +1830,6 @@ notify_connect_result (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1835 | ctx->hello_send_task = GNUNET_SCHEDULER_NO_TASK; | 1830 | ctx->hello_send_task = GNUNET_SCHEDULER_NO_TASK; |
1836 | } | 1831 | } |
1837 | 1832 | ||
1838 | if (ctx->connect_request_handle != NULL) | ||
1839 | { | ||
1840 | GNUNET_CORE_peer_request_connect_cancel (ctx->connect_request_handle); | ||
1841 | ctx->connect_request_handle = NULL; | ||
1842 | } | ||
1843 | |||
1844 | if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) | 1833 | if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) |
1845 | { | 1834 | { |
1846 | if (ctx->d1th != NULL) | 1835 | if (ctx->d1th != NULL) |
@@ -1919,19 +1908,6 @@ connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
1919 | ctx->timeout_task = GNUNET_SCHEDULER_add_now (¬ify_connect_result, ctx); | 1908 | ctx->timeout_task = GNUNET_SCHEDULER_add_now (¬ify_connect_result, ctx); |
1920 | } | 1909 | } |
1921 | 1910 | ||
1922 | /** | ||
1923 | * Task called once a core connect request has been transmitted. | ||
1924 | * | ||
1925 | * @param cls struct GNUNET_TESTING_ConnectContext | ||
1926 | * @param success was the request successful? | ||
1927 | */ | ||
1928 | void | ||
1929 | core_connect_request_cont (void *cls, int success) | ||
1930 | { | ||
1931 | struct GNUNET_TESTING_ConnectContext *ctx = cls; | ||
1932 | |||
1933 | ctx->connect_request_handle = NULL; | ||
1934 | } | ||
1935 | 1911 | ||
1936 | static void | 1912 | static void |
1937 | send_hello (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 1913 | send_hello (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
@@ -1954,10 +1930,7 @@ send_hello (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1954 | #endif | 1930 | #endif |
1955 | GNUNET_TRANSPORT_offer_hello (ctx->d1th, hello, NULL, NULL); | 1931 | GNUNET_TRANSPORT_offer_hello (ctx->d1th, hello, NULL, NULL); |
1956 | GNUNET_assert (ctx->d1core != NULL); | 1932 | GNUNET_assert (ctx->d1core != NULL); |
1957 | ctx->connect_request_handle = | 1933 | GNUNET_TRANSPORT_try_connect (ctx->d1th, &ctx->d2->id); |
1958 | GNUNET_CORE_peer_request_connect (ctx->d1core, &ctx->d2->id, | ||
1959 | &core_connect_request_cont, ctx); | ||
1960 | |||
1961 | #if DEBUG_TESTING | 1934 | #if DEBUG_TESTING |
1962 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1935 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1963 | "Sending connect request to CORE of %s for peer %s\n", | 1936 | "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, | |||
1993 | 1966 | ||
1994 | if (connect_ctx->send_hello == GNUNET_NO) | 1967 | if (connect_ctx->send_hello == GNUNET_NO) |
1995 | { | 1968 | { |
1996 | connect_ctx->connect_request_handle = | 1969 | GNUNET_TRANSPORT_try_connect (connect_ctx->d1th, |
1997 | GNUNET_CORE_peer_request_connect (connect_ctx->d1core, | 1970 | &connect_ctx->d2->id); |
1998 | &connect_ctx->d2->id, | ||
1999 | &core_connect_request_cont, | ||
2000 | connect_ctx); | ||
2001 | GNUNET_assert (connect_ctx->connect_request_handle != NULL); | ||
2002 | #if DEBUG_TESTING | 1971 | #if DEBUG_TESTING |
2003 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1972 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2004 | "Sending connect request to CORE of %s for peer %s\n", | 1973 | "Sending connect request to TRANSPORT of %s for peer %s\n", |
2005 | connect_ctx->d1->shortname, connect_ctx->d2->shortname); | 1974 | connect_ctx->d1->shortname, connect_ctx->d2->shortname); |
2006 | #endif | 1975 | #endif |
2007 | } | 1976 | } |
@@ -2098,9 +2067,7 @@ reattempt_daemons_connect (void *cls, | |||
2098 | } | 2067 | } |
2099 | else | 2068 | else |
2100 | { | 2069 | { |
2101 | ctx->connect_request_handle = | 2070 | GNUNET_TRANSPORT_try_connect (ctx->d1th, &ctx->d2->id); |
2102 | GNUNET_CORE_peer_request_connect (ctx->d1core, &ctx->d2->id, | ||
2103 | &core_connect_request_cont, ctx); | ||
2104 | } | 2071 | } |
2105 | ctx->timeout_task = | 2072 | ctx->timeout_task = |
2106 | GNUNET_SCHEDULER_add_delayed (ctx->relative_timeout, | 2073 | 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, | |||
3347 | conn = send_hello_context->peer->connect_peers_head; | 3347 | conn = send_hello_context->peer->connect_peers_head; |
3348 | while (conn != NULL) | 3348 | while (conn != NULL) |
3349 | { | 3349 | { |
3350 | GNUNET_CORE_peer_request_connect (send_hello_context->peer-> | 3350 | GNUNET_TRANSPORT_try_connect (send_hello_context->peer->daemon->th, |
3351 | daemon->server, | 3351 | &send_hello_context->pg->peers[conn->index].daemon->id); |
3352 | &send_hello_context->pg-> | ||
3353 | peers[conn->index].daemon->id, NULL, | ||
3354 | NULL); | ||
3355 | conn = conn->next; | 3352 | conn = conn->next; |
3356 | } | 3353 | } |
3357 | send_hello_context->core_connect_task = | 3354 | send_hello_context->core_connect_task = |