#define TEST_MESSAGE_TYPE 12345
-static struct GNUNET_TRANSPORT_TransmitHandle *th;
-
static struct GNUNET_TRANSPORT_TESTING_ConnectCheckContext *ccc;
static struct GNUNET_TRANSPORT_PeerMonitoringContext *pmc_p1;
static void
custom_shutdown (void *cls)
{
- if (th != NULL)
- {
- GNUNET_TRANSPORT_notify_transmit_ready_cancel (th);
- th = NULL;
- }
if (NULL != pmc_p1)
{
GNUNET_TRANSPORT_monitor_peers_cancel (pmc_p1);
}
-static void
-notify_disconnect (void *cls,
- struct GNUNET_TRANSPORT_TESTING_PeerContext *me,
- const struct GNUNET_PeerIdentity *other)
-{
- GNUNET_TRANSPORT_TESTING_log_disconnect (cls,
- me,
- other);
- if (NULL != th)
- {
- GNUNET_TRANSPORT_notify_transmit_ready_cancel (th);
- th = NULL;
- }
-}
-
-
static void
monitor1_cb (void *cls,
const struct GNUNET_PeerIdentity *peer,
.config_file = "test_transport_api_data.conf",
.rec = ¬ify_receive,
.nc = ¬ify_connect,
- .nd = ¬ify_disconnect,
+ .nd = &GNUNET_TRANSPORT_TESTING_log_disconnect,
.shutdown_task = &custom_shutdown,
.timeout = TIMEOUT
};