diff options
Diffstat (limited to 'src/transport/transport_api_cmd_connecting_peers.c')
-rw-r--r-- | src/transport/transport_api_cmd_connecting_peers.c | 49 |
1 files changed, 17 insertions, 32 deletions
diff --git a/src/transport/transport_api_cmd_connecting_peers.c b/src/transport/transport_api_cmd_connecting_peers.c index ddf1c3872..82194ff15 100644 --- a/src/transport/transport_api_cmd_connecting_peers.c +++ b/src/transport/transport_api_cmd_connecting_peers.c | |||
@@ -42,6 +42,11 @@ | |||
42 | */ | 42 | */ |
43 | struct ConnectPeersState | 43 | struct ConnectPeersState |
44 | { | 44 | { |
45 | /** | ||
46 | * Context for our asynchronous completion. | ||
47 | */ | ||
48 | struct GNUNET_TESTING_AsyncContext ac; | ||
49 | |||
45 | // Label of the cmd which started the test system. | 50 | // Label of the cmd which started the test system. |
46 | const char *create_label; | 51 | const char *create_label; |
47 | 52 | ||
@@ -183,6 +188,7 @@ connect_peers_run (void *cls, | |||
183 | * The finish function of this cmd will check if the peer we are trying to connect to is in the connected peers map of the start peer cmd for this peer. | 188 | * The finish function of this cmd will check if the peer we are trying to connect to is in the connected peers map of the start peer cmd for this peer. |
184 | * | 189 | * |
185 | */ | 190 | */ |
191 | // FIXME: this needs a complete rewrite! | ||
186 | static int | 192 | static int |
187 | connect_peers_finish (void *cls, | 193 | connect_peers_finish (void *cls, |
188 | GNUNET_SCHEDULER_TaskCallback cont, | 194 | GNUNET_SCHEDULER_TaskCallback cont, |
@@ -222,20 +228,6 @@ connect_peers_finish (void *cls, | |||
222 | 228 | ||
223 | 229 | ||
224 | /** | 230 | /** |
225 | * Trait function of this cmd does nothing. | ||
226 | * | ||
227 | */ | ||
228 | static int | ||
229 | connect_peers_traits (void *cls, | ||
230 | const void **ret, | ||
231 | const char *trait, | ||
232 | unsigned int index) | ||
233 | { | ||
234 | return GNUNET_OK; | ||
235 | } | ||
236 | |||
237 | |||
238 | /** | ||
239 | * The cleanup function of this cmd frees resources the cmd allocated. | 231 | * The cleanup function of this cmd frees resources the cmd allocated. |
240 | * | 232 | * |
241 | */ | 233 | */ |
@@ -249,13 +241,6 @@ connect_peers_cleanup (void *cls) | |||
249 | } | 241 | } |
250 | 242 | ||
251 | 243 | ||
252 | /** | ||
253 | * Create command. | ||
254 | * | ||
255 | * @param label name for command. | ||
256 | * @param start_peer_label Label of the cmd to start a peer. | ||
257 | * @return command. | ||
258 | */ | ||
259 | struct GNUNET_TESTING_Command | 244 | struct GNUNET_TESTING_Command |
260 | GNUNET_TRANSPORT_cmd_connect_peers (const char *label, | 245 | GNUNET_TRANSPORT_cmd_connect_peers (const char *label, |
261 | const char *start_peer_label, | 246 | const char *start_peer_label, |
@@ -269,15 +254,15 @@ GNUNET_TRANSPORT_cmd_connect_peers (const char *label, | |||
269 | cps->num = num; | 254 | cps->num = num; |
270 | cps->create_label = create_label; | 255 | cps->create_label = create_label; |
271 | 256 | ||
272 | 257 | { | |
273 | struct GNUNET_TESTING_Command cmd = { | 258 | struct GNUNET_TESTING_Command cmd = { |
274 | .cls = cps, | 259 | .cls = cps, |
275 | .label = label, | 260 | .label = label, |
276 | .run = &connect_peers_run, | 261 | .run = &connect_peers_run, |
277 | .finish = &connect_peers_finish, | 262 | .ac = &cps->ac, |
278 | .cleanup = &connect_peers_cleanup, | 263 | .cleanup = &connect_peers_cleanup |
279 | .traits = &connect_peers_traits | 264 | }; |
280 | }; | 265 | |
281 | 266 | return cmd; | |
282 | return cmd; | 267 | } |
283 | } | 268 | } |