- die_task = NULL;
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Fail! Stopping peers\n");
-
- if (send_task != NULL)
- {
- GNUNET_SCHEDULER_cancel (send_task);
- send_task = NULL;
- }
-
- if (cc != NULL)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Fail! Could not connect peers\n"));
- GNUNET_TRANSPORT_TESTING_connect_peers_cancel (tth, cc);
- cc = NULL;
- }
-
- if (th != NULL)
- GNUNET_TRANSPORT_notify_transmit_ready_cancel (th);
- else
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Peer were not ready to send data\n"));
-
- if (s_started == GNUNET_NO)
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Peers were not started \n"));
- else
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Peers were started \n"));
-
- if (s_connected == GNUNET_NO)
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Peer were not connected\n"));
- else
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Peer were connected\n"));
-
- if (s_sending == GNUNET_NO)
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Peer were not ready to send data\n"));
- else
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Peer were ready to send data\n"));
-
- th = NULL;
-
- if (NULL != pmc_p1)
- {
- GNUNET_TRANSPORT_monitor_peers_cancel (pmc_p1);
- pmc_p1 = NULL;
- }
- if (NULL != pmc_p2)
- {
- GNUNET_TRANSPORT_monitor_peers_cancel (pmc_p2);
- pmc_p2 = NULL;
- }
-
- if (p1 != NULL)
- GNUNET_TRANSPORT_TESTING_stop_peer (tth, p1);
- else
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Peer 1 was not started\n"));
- if (p2 != NULL)
- GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2);
- else
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Peer 2 was not started\n"));
-
- ok = GNUNET_SYSERR;
-}
-
-
-static void
-notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_MessageHeader *message)
-{
- struct PeerContext *p = cls;
- struct PeerContext *t = NULL;
-
- if (0 == memcmp (peer, &p1->id, sizeof (struct GNUNET_PeerIdentity)))
- t = p1;
- if (0 == memcmp (peer, &p2->id, sizeof (struct GNUNET_PeerIdentity)))
- t = p2;
- GNUNET_assert (t != NULL);
-
- char *ps = GNUNET_strdup (GNUNET_i2s (&p->id));
-
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Peer %u (`%4s') received message of type %d and size %u size from peer %u (`%4s')!\n",
- p->no, ps, ntohs (message->type), ntohs (message->size), t->no,
- GNUNET_i2s (&t->id));