at least compiling fix
[oweals/gnunet.git] / src / transport / test_transport_api_monitor_peers.c
index 1f0eb184c9b211767ebe7d275cb82264dc8f7e74..4a0f1a23f62d7b03dcf15f3806647927caf935ba 100644 (file)
@@ -39,8 +39,6 @@
 
 #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;
@@ -59,11 +57,6 @@ static int p2_c_notify;
 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);
@@ -81,7 +74,7 @@ static void
 notify_receive (void *cls,
                 struct GNUNET_TRANSPORT_TESTING_PeerContext *receiver,
                 const struct GNUNET_PeerIdentity *sender,
-                const struct GNUNET_MessageHeader *message)
+                const struct GNUNET_TRANSPORT_TESTING_TestMessage *message)
 {
   char *ps = GNUNET_strdup (GNUNET_i2s (&receiver->id));
 
@@ -89,8 +82,8 @@ notify_receive (void *cls,
               "Peer %u (`%s') received message of type %d and size %u size from peer %s!\n",
               receiver->no,
               ps,
-              ntohs (message->type),
-              ntohs (message->size),
+              ntohs (message->header.type),
+              ntohs (message->header.size),
               GNUNET_i2s (sender));
   GNUNET_free (ps);
 }
@@ -139,22 +132,6 @@ notify_connect (void *cls,
 }
 
 
-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,
@@ -230,7 +207,7 @@ main (int argc, char *argv[])
     .config_file = "test_transport_api_data.conf",
     .rec = &notify_receive,
     .nc = &notify_connect,
-    .nd = &notify_disconnect,
+    .nd = &GNUNET_TRANSPORT_TESTING_log_disconnect,
     .shutdown_task = &custom_shutdown,
     .timeout = TIMEOUT
   };