- GNUNET_assert (t != NULL);
-
- char *ps = GNUNET_strdup (GNUNET_i2s (&p->id));
-
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Peer %u (`%4s'): peer %u (`%s') connected to me!\n", p->no, ps,
- t->no, GNUNET_i2s (peer));
- if (p1_c_notify && p2_c_notify)
- GNUNET_SCHEDULER_add_now(&done, NULL);
- GNUNET_free (ps);
-}
-
-
-static void
-notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
-{
- struct PeerContext *p = cls;
- char *ps = GNUNET_strdup (GNUNET_i2s (&p->id));
-
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Peer %u (`%4s'): peer (`%s') disconnected from me!\n", p->no, ps,
- GNUNET_i2s (peer));
-
- GNUNET_free (ps);
-
- if (th != NULL)
- GNUNET_TRANSPORT_notify_transmit_ready_cancel (th);
- th = NULL;
-}
-
-
-static void
-testing_connect_cb (struct PeerContext *p1,
- struct PeerContext *p2,
- void *cls)
-{
- cc = NULL;
- char *p1_c = GNUNET_strdup (GNUNET_i2s (&p1->id));
-
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Peers connected: %u (%s) <-> %u (%s)\n",
- p1->no, p1_c, p2->no, GNUNET_i2s (&p2->id));
- GNUNET_free (p1_c);
-
- s_connected = GNUNET_YES;
- send_task = GNUNET_SCHEDULER_add_now (&sendtask, NULL);
-}
-
-
-static void
-start_cb (struct PeerContext *p, void *cls)
-{
- static int started;
-
- started++;
-
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Peer %u (`%s') started\n", p->no,
- GNUNET_i2s (&p->id));
-
- if (started != 2)
- return;
- else
- s_started = GNUNET_YES;
- char *sender_c = GNUNET_strdup (GNUNET_i2s (&p1->id));
-
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Test tries to connect peer %u (`%s') -> peer %u (`%s')\n",
- p1->no, sender_c, p2->no, GNUNET_i2s (&p2->id));
- GNUNET_free (sender_c);
-
- cc = GNUNET_TRANSPORT_TESTING_connect_peers (tth, p1, p2, &testing_connect_cb,
- NULL);
-