WiP
[oweals/gnunet.git] / src / core / test_core_api.c
index 814ebe889e8f0a513ee8b9a530718ec43d10075d..38aaf63b175afdb1944448fa8e20d73d47d4ede1 100644 (file)
@@ -123,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)
@@ -134,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,
@@ -154,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));
@@ -267,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);
 }