(no commit message)
[oweals/gnunet.git] / src / transport / test_transport_api.c
index 50d0d36e07ba791916f1f1c885a365a38a4c77b8..cd09511acabba980f3ca368e63969306b29de78c 100644 (file)
@@ -4,7 +4,7 @@
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 2, or (at your
+     by the Free Software Foundation; either version 3, or (at your
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
@@ -36,7 +36,7 @@
 #include "gnunet_transport_service.h"
 #include "transport.h"
 
-#define VERBOSE GNUNET_NO
+#define VERBOSE GNUNET_YES
 
 #define VERBOSE_ARM GNUNET_NO
 
 /**
  * How long until we give up on transmitting the message?
  */
-#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 50)
+#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 300)
+
+/**
+ * How long until we give up on transmitting the message?
+ */
+#define TIMEOUT_TRANSMIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
 
 #define MTYPE 12345
 
@@ -176,6 +181,11 @@ notify_connect (void *cls,
 {
   if (cls == &p1)
     {
+      GNUNET_SCHEDULER_cancel (sched, die_task);
+      die_task = GNUNET_SCHEDULER_add_delayed (sched,
+                                              TIMEOUT_TRANSMIT, 
+                                              &end_badly, NULL);
+
       GNUNET_TRANSPORT_notify_transmit_ready (p1.th,
                                              &p2.id,
                                              256, 0, TIMEOUT, &notify_ready,
@@ -270,7 +280,8 @@ run (void *cls,
   sched = s;
 
   die_task = GNUNET_SCHEDULER_add_delayed (sched,
-      GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 1), &end_badly, NULL);
+                                          TIMEOUT, 
+                                          &end_badly, NULL);
 
   if (is_udp)
     {