X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fstream%2Ftest_stream_local.c;h=af1b8ff84de1f0ba5dff62d14e7b70a51732be63;hb=32566458738aa4d91d02616ef4f38c2614acf301;hp=e660d77d728ca7015b428208d341cdf5a738f1cc;hpb=d0ddec50cd8ebed5269ce277195cc858b8ea709c;p=oweals%2Fgnunet.git diff --git a/src/stream/test_stream_local.c b/src/stream/test_stream_local.c index e660d77d7..af1b8ff84 100644 --- a/src/stream/test_stream_local.c +++ b/src/stream/test_stream_local.c @@ -335,19 +335,12 @@ stream_listen_cb (void *cls, /** - * Task for connecting the peer to stream as client - * - * @param cls PeerData - * @param tc the TaskContext + * Listen success callback; connects a peer to stream as client */ static void -stream_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) +stream_connect (void) { - struct PeerData *peer = cls; - - GNUNET_assert (&peer1 == peer); - /* Connect to stream library */ - peer->socket = GNUNET_STREAM_open (config, + peer1.socket = GNUNET_STREAM_open (config, &self_id, 10, /* App port */ &stream_open_cb, @@ -368,13 +361,15 @@ run (void *cls, config = cfg; self = peer; GNUNET_TESTING_peer_get_identity (peer, &self_id); - peer2_listen_socket = GNUNET_STREAM_listen (config, - 10, /* App port */ - &stream_listen_cb, - &peer2, - GNUNET_STREAM_OPTION_END); + peer2_listen_socket = + GNUNET_STREAM_listen (config, + 10, /* App port */ + &stream_listen_cb, + &peer2, + GNUNET_STREAM_OPTION_SIGNAL_LISTEN_SUCCESS, + &stream_connect, + GNUNET_STREAM_OPTION_END); GNUNET_assert (NULL != peer2_listen_socket); - GNUNET_SCHEDULER_add_delayed (TIME_REL_SECS(2), &stream_connect, &peer1); abort_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30), &do_abort,