fixing leak
[oweals/gnunet.git] / src / core / test_core_api.c
index 4a8546bbe6eaecf7f1c74640d2b89f6e2d897768..38aaf63b175afdb1944448fa8e20d73d47d4ede1 100644 (file)
@@ -34,8 +34,7 @@
 #include "gnunet_scheduler_lib.h"
 #include "gnunet_transport_service.h"
 
-#define VERBOSE GNUNET_YES
-
+#define VERBOSE GNUNET_NO
 #define START_ARM GNUNET_YES
 
 #define MTYPE 12345
@@ -124,6 +123,10 @@ connect_notify (void *cls,
 {
   struct PeerContext *pc = cls;
 
+  if (0 == memcmp (&pc->id,
+                  peer,
+                  sizeof (struct GNUNET_PeerIdentity)))
+    return;
   GNUNET_assert (pc->connect_status == 0);
   pc->connect_status = 1;
   if (pc == &p1)
@@ -135,6 +138,7 @@ connect_notify (void *cls,
                  "Asking core (1) for transmission to peer `%4s'\n",
                  GNUNET_i2s (&p2.id));
       if (NULL == GNUNET_CORE_notify_transmit_ready (p1.ch,
+                                                    GNUNET_YES,
                                                     0,
                                                     GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 45),
                                                     &p2.id,
@@ -155,6 +159,10 @@ disconnect_notify (void *cls,
 {
   struct PeerContext *pc = cls;
 
+  if (0 == memcmp (&pc->id,
+                  peer,
+                  sizeof (struct GNUNET_PeerIdentity)))
+    return;
   pc->connect_status = 0;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Encrypted connection to `%4s' cut\n", GNUNET_i2s (peer));
@@ -268,14 +276,14 @@ process_hello (void *cls,
   p->hello = GNUNET_malloc (ntohs (message->size));
   memcpy (p->hello, message, ntohs (message->size));
   if ((p == &p1) && (p2.th != NULL))
-    GNUNET_TRANSPORT_offer_hello (p2.th, message);
+    GNUNET_TRANSPORT_offer_hello (p2.th, message, NULL, NULL);
   if ((p == &p2) && (p1.th != NULL))
-    GNUNET_TRANSPORT_offer_hello (p1.th, message);
+    GNUNET_TRANSPORT_offer_hello (p1.th, message, NULL, NULL);
 
   if ((p == &p1) && (p2.hello != NULL))
-    GNUNET_TRANSPORT_offer_hello (p1.th, p2.hello);
+    GNUNET_TRANSPORT_offer_hello (p1.th, p2.hello, NULL, NULL);
   if ((p == &p2) && (p1.hello != NULL))
-    GNUNET_TRANSPORT_offer_hello (p2.th, p1.hello);
+    GNUNET_TRANSPORT_offer_hello (p2.th, p1.hello, NULL, NULL);
 }
 
 
@@ -319,7 +327,6 @@ run (void *cls,
                        GNUNET_YES, &outbound_notify, GNUNET_YES, handlers);
 }
 
-
 static void
 stop_arm (struct PeerContext *p)
 {