Allowed to destroy NULL paths
[oweals/gnunet.git] / src / mesh / test_mesh_small_unicast_far.c
index 8833ce2877630a027d0a7bcc1f12107636df87d6..f5bab6fb4c1eb406f55e81fa012191170c7a9caa 100644 (file)
@@ -120,8 +120,6 @@ static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle;
 
 static char *topology_file;
 
-static char *data_filename;
-
 static struct GNUNET_TESTING_Daemon *d1;
 
 static struct GNUNET_TESTING_Daemon *d2;
@@ -213,7 +211,7 @@ static void *
 incoming_tunnel (void *cls,
                  struct GNUNET_MESH_Tunnel * tunnel,
                  const struct GNUNET_PeerIdentity * initiator,
-                 const struct GNUNET_TRANSPORT_ATS_Information * atsi)
+                 const struct GNUNET_ATS_Information * atsi)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "test: Incoming tunnel from %s\n",
@@ -269,7 +267,7 @@ dh (void *cls, const struct GNUNET_PeerIdentity *peer)
  */
 static void
 ch (void *cls, const struct GNUNET_PeerIdentity *peer,
-    const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+    const struct GNUNET_ATS_Information *atsi)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "test: peer %s connected\n",
@@ -460,6 +458,8 @@ run (void *cls, char *const *args, const char *cfgfile,
   char *temp_str;
   unsigned long long temp_wait;
   struct GNUNET_TESTING_Host *hosts;
+  char *data_filename;
+
 
   ok = 1;
   testing_cfg = GNUNET_CONFIGURATION_dup (cfg);
@@ -516,27 +516,23 @@ run (void *cls, char *const *args, const char *cfgfile,
     return;
   }
 
-  if (GNUNET_OK !=
+  if (GNUNET_OK ==
       GNUNET_CONFIGURATION_get_value_string (testing_cfg, "test_mesh_small",
                                              "data_output_file",
                                              &data_filename))
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Option test_mesh_small:data_output_file is required!\n");
-    return;
-  }
-
-  data_file =
+    data_file =
       GNUNET_DISK_file_open (data_filename,
                              GNUNET_DISK_OPEN_READWRITE |
                              GNUNET_DISK_OPEN_CREATE,
                              GNUNET_DISK_PERM_USER_READ |
                              GNUNET_DISK_PERM_USER_WRITE);
-  if (data_file == NULL)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
-                data_filename);
-    GNUNET_free (data_filename);
+    if (data_file == NULL)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
+                 data_filename);
+      GNUNET_free (data_filename);
+    }
   }
 
   wait_time =