diff options
Diffstat (limited to 'src/transport/test_transport_api.c')
-rw-r--r-- | src/transport/test_transport_api.c | 52 |
1 files changed, 1 insertions, 51 deletions
diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c index 49e160ddb..d0159927e 100644 --- a/src/transport/test_transport_api.c +++ b/src/transport/test_transport_api.c | |||
@@ -38,7 +38,6 @@ | |||
38 | #include "transport-testing.h" | 38 | #include "transport-testing.h" |
39 | 39 | ||
40 | #define VERBOSE GNUNET_EXTRA_LOGGING | 40 | #define VERBOSE GNUNET_EXTRA_LOGGING |
41 | |||
42 | #define VERBOSE_ARM GNUNET_EXTRA_LOGGING | 41 | #define VERBOSE_ARM GNUNET_EXTRA_LOGGING |
43 | 42 | ||
44 | #define START_ARM GNUNET_YES | 43 | #define START_ARM GNUNET_YES |
@@ -92,55 +91,7 @@ static void | |||
92 | end () | 91 | end () |
93 | { | 92 | { |
94 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); | 93 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); |
95 | #if 0 | ||
96 | static void | ||
97 | get_hello_p2 (void *cb_cls, const struct GNUNET_MessageHeader *message); | ||
98 | |||
99 | static void | ||
100 | get_hello_p1 (void *cb_cls, const struct GNUNET_MessageHeader *message); | ||
101 | |||
102 | static void | ||
103 | notify_connect_internal (void *cls, const struct GNUNET_PeerIdentity *peer, | ||
104 | const struct GNUNET_TRANSPORT_ATS_Information *ats, | ||
105 | uint32_t ats_count) | ||
106 | { | ||
107 | struct ConnectingContext *cc = cls; | ||
108 | |||
109 | GNUNET_assert (cc != NULL); | ||
110 | 94 | ||
111 | if (0 == | ||
112 | memcmp (&(*peer).hashPubKey, &cc->p1->id.hashPubKey, | ||
113 | sizeof (GNUNET_HashCode))) | ||
114 | { | ||
115 | if (cc->p1_c == GNUNET_NO) | ||
116 | cc->p1_c = GNUNET_YES; | ||
117 | } | ||
118 | if (0 == | ||
119 | memcmp (&(*peer).hashPubKey, &cc->p2->id.hashPubKey, | ||
120 | sizeof (GNUNET_HashCode))) | ||
121 | { | ||
122 | if (cc->p2_c == GNUNET_NO) | ||
123 | cc->p2_c = GNUNET_YES; | ||
124 | } | ||
125 | |||
126 | if ((cc->p2_c == GNUNET_YES) && (cc->p2_c == GNUNET_YES)) | ||
127 | { | ||
128 | /* clean up */ | ||
129 | if (cc->tct != GNUNET_SCHEDULER_NO_TASK) | ||
130 | GNUNET_SCHEDULER_cancel (cc->tct); | ||
131 | |||
132 | cc->tct = GNUNET_SCHEDULER_NO_TASK; | ||
133 | |||
134 | GNUNET_TRANSPORT_disconnect (cc->th_p1); | ||
135 | GNUNET_TRANSPORT_disconnect (cc->th_p2); | ||
136 | |||
137 | if (cc->cb != NULL) | ||
138 | cc->cb (cc->p1, cc->p2, cc->cb_cls); | ||
139 | |||
140 | GNUNET_free (cc); | ||
141 | } | ||
142 | } | ||
143 | #endif | ||
144 | if (send_task != GNUNET_SCHEDULER_NO_TASK) | 95 | if (send_task != GNUNET_SCHEDULER_NO_TASK) |
145 | GNUNET_SCHEDULER_cancel (send_task); | 96 | GNUNET_SCHEDULER_cancel (send_task); |
146 | 97 | ||
@@ -170,6 +121,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
170 | { | 121 | { |
171 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Fail! Could not connect peers\n")); | 122 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Fail! Could not connect peers\n")); |
172 | GNUNET_TRANSPORT_TESTING_connect_peers_cancel (tth, cc); | 123 | GNUNET_TRANSPORT_TESTING_connect_peers_cancel (tth, cc); |
124 | cc = NULL; | ||
173 | } | 125 | } |
174 | 126 | ||
175 | if (th != NULL) | 127 | if (th != NULL) |
@@ -181,8 +133,6 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
181 | if (p2 != NULL) | 133 | if (p2 != NULL) |
182 | GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2); | 134 | GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2); |
183 | 135 | ||
184 | GNUNET_TRANSPORT_TESTING_done (tth); | ||
185 | |||
186 | ok = GNUNET_SYSERR; | 136 | ok = GNUNET_SYSERR; |
187 | } | 137 | } |
188 | 138 | ||