safety check
[oweals/gnunet.git] / src / transport / test_transport_api_reliability.c
index ce031af7f305ab1e7e3f6511ab2871a19b9a1f5d..96e0d988dec1c1aa5dbf01d554f3ce3a5eb7e135 100644 (file)
@@ -185,8 +185,8 @@ static void
 notify_receive (void *cls,
                 const struct GNUNET_PeerIdentity *peer,
                 const struct GNUNET_MessageHeader *message,
-                struct GNUNET_TIME_Relative latency,
-               uint32_t distance)
+                const struct GNUNET_TRANSPORT_ATS_Information *ats,
+                uint32_t ats_count)
 {
   static int n;
   unsigned int s;
@@ -324,8 +324,8 @@ notify_ready (void *cls, size_t size, void *buf)
 static void
 notify_connect (void *cls,
                 const struct GNUNET_PeerIdentity *peer,
-                struct GNUNET_TIME_Relative latency,
-               uint32_t distance)
+                const struct GNUNET_TRANSPORT_ATS_Information *ats,
+                uint32_t ats_count)
 {
   if (cls == &p1)
     {
@@ -455,6 +455,11 @@ setup_peer (struct PeerContext *p, const char *cfgname)
   GNUNET_assert (p->th != NULL);
 }
 
+static size_t
+notify_ready_connect (void *cls, size_t size, void *buf)
+{
+  return 0;
+}
 
 static void
 exchange_hello_last (void *cls,
@@ -473,6 +478,14 @@ exchange_hello_last (void *cls,
   GNUNET_assert (GNUNET_OK ==
                  GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *)
                                       message, &me->id));
+
+  GNUNET_assert(NULL != GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
+                                          &p1.id,
+                                          sizeof (struct GNUNET_MessageHeader), 0,
+                                          TIMEOUT,
+                                          &notify_ready_connect,
+                                          NULL));
+
   /* both HELLOs exchanged, get ready to test transmission! */
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Finished exchanging HELLOs, now waiting for transmission!\n");
@@ -743,6 +756,10 @@ main (int argc, char *argv[])
 #ifdef MINGW
   return GNUNET_SYSERR;
 #endif
+
+  GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-1");
+  GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-2");
+
   if (strstr(argv[0], "tcp_nat") != NULL)
     {
       is_tcp_nat = GNUNET_YES;