-doxygen
[oweals/gnunet.git] / src / transport / test_transport_api_disconnect.c
index 7a26c7eae53e4ac680051edf7d1a72bce87cb20d..24eaa9f7143778a863a20812ced1fec3ffbd1399 100644 (file)
@@ -147,6 +147,7 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "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);
@@ -176,10 +177,10 @@ stop_peer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   GNUNET_assert (p2 == NULL);
 }
 
+
 static void
 notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
-                const struct GNUNET_MessageHeader *message,
-                const struct GNUNET_ATS_Information *ats, uint32_t ats_count)
+                const struct GNUNET_MessageHeader *message)
 {
   struct PeerContext *p = cls;
   struct PeerContext *t = NULL;
@@ -196,6 +197,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
               "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));
+  GNUNET_free (ps);
 
   if ((MTYPE == ntohs (message->type)) &&
       (sizeof (struct GNUNET_MessageHeader) == ntohs (message->size)))
@@ -266,8 +268,7 @@ sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 
 static void
-notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
-                const struct GNUNET_ATS_Information *ats, uint32_t ats_count)
+notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
 {
   static int c;
 
@@ -304,31 +305,29 @@ testing_connect_cb (struct PeerContext *p1, struct PeerContext *p2, void *cls)
 }
 
 
-
-void
+static void
 start_cb (struct PeerContext *p, void *cls)
 {
   static int started;
 
   started++;
-
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer %u (`%s') started\n", p->no,
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Peer %u (`%s') started\n", p->no,
               GNUNET_i2s (&p->id));
-
   if (started != 2)
     return;
-
   char *sender_c = GNUNET_strdup (GNUNET_i2s (&p1->id));
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "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);
 
 }
 
+
 static void
 run (void *cls, char *const *args, const char *cfgfile,
      const struct GNUNET_CONFIGURATION_Handle *cfg)