fixme
[oweals/gnunet.git] / src / transport / test_plugin_transport.c
index 7891c24d03e4d76f1e347eb674063aa5d68be3e7..b43c534c56483c9079928b6e1794861df8a7c297 100644 (file)
@@ -37,7 +37,7 @@
 #include "plugin_transport.h"
 #include "transport.h"
 
-#define VERBOSE GNUNET_YES
+#define VERBOSE GNUNET_NO
 
 /**
  * How long until we give up on transmitting the message?
@@ -145,6 +145,15 @@ unload_plugins (void *cls,
 }
 
 
+static void
+unload_task (void *cls,
+            const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+  struct GNUNET_CONFIGURATION_Handle *cfg = cls;
+  unload_plugins (NULL, cfg);
+}
+
+
 static GNUNET_SCHEDULER_TaskIdentifier validation_timeout_task;
 
 
@@ -169,7 +178,10 @@ validation_notification (void *cls,
   /* Sailor: if this is the last test, calling this function
      here will end the process. */
   ok = 0; /* if the last test succeeded, report success */
-  unload_plugins (NULL, cfg);
+  GNUNET_SCHEDULER_add_continuation (sched,
+                                    &unload_task,
+                                    (void*) cfg,
+                                    GNUNET_SCHEDULER_REASON_PREREQ_DONE);
 }
 
 
@@ -197,6 +209,9 @@ validation_failed (void *cls,
  *  work for other plugins; we should ask
  *  the plugin about its address instead...).
  */
+/* FIXME: won't work on IPv6 enabled systems where IPv4 bridge
+ * mode isn't enabled (eg. FreeBSD > 4)
+ */
 static void
 test_validation ()
 {
@@ -223,9 +238,6 @@ test_validation ()
   /* add job to catch failure (timeout) */
   validation_timeout_task =
     GNUNET_SCHEDULER_add_delayed (sched,
-                                 GNUNET_NO,
-                                 GNUNET_SCHEDULER_PRIORITY_KEEP,
-                                 GNUNET_SCHEDULER_NO_TASK,
                                  TIMEOUT,
                                  &validation_failed,
                                  NULL);
@@ -309,6 +321,7 @@ run (void *cls,
   GNUNET_asprintf (&libname, "libgnunet_plugin_transport_tcp");
 
   api = GNUNET_PLUGIN_load(libname, &env);
+  GNUNET_free (libname);
   if (api == NULL)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,