fix
[oweals/gnunet.git] / src / testing / testing_group.c
index e74d5b9ef2c8b30fd8c32d013e7167bfa97b6a18..a09460844476a3a4402250982459b6fdd1a2a5b6 100644 (file)
@@ -59,9 +59,9 @@
 
 #define MAX_CONCURRENT_SHUTDOWN 10
 
-#define CONNECT_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 300)
+#define CONNECT_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 200)
 
-#define CONNECT_ATTEMPTS 8
+#define CONNECT_ATTEMPTS 21
 
 /**
  * Prototype of a function called whenever two peers would be connected
@@ -842,10 +842,11 @@ update_config (void *cls,
                            "/tmp/test-service-%s-%u", section, ctx->upnum++);
           value = uval;
         }
-      else if (GNUNET_YES ==
+      else if ((GNUNET_YES ==
                GNUNET_CONFIGURATION_get_value_number (ctx->orig, "testing",
                                                       per_host_variable,
-                                                      &num_per_host))
+                                                      &num_per_host)) && (num_per_host > 0))
+
         {
           GNUNET_snprintf (uval,
                            sizeof (uval),
@@ -1489,14 +1490,14 @@ create_nated_internet (struct GNUNET_TESTING_PeerGroup *pg,
   nat_percentage = 0.6;         /* FIXME: default percentage? */
   if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (pg->cfg,
                                                           "TESTING",
-                                                          "NATPERCENTAGE",
+                                                          "PERCENTAGE",
                                                           &p_string))
     {
       if (sscanf (p_string, "%lf", &nat_percentage) != 1)
         GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                     _
                     ("Invalid value `%s' for option `%s' in section `%s': expected float\n"),
-                    p_string, "NATPERCENTAGE", "TESTING");
+                    p_string, "PERCENTAGE", "TESTING");
       GNUNET_free (p_string);
     }
 
@@ -2504,6 +2505,9 @@ copy_allowed_topology (struct GNUNET_TESTING_PeerGroup *pg)
  * of each peer in the peer group
  *
  * @param pg the peer group we are dealing with
+ * @param notify_callback callback to notify when finished
+ * @param notify_cls closure for notify callback
+ *
  * @return the number of connections that will be attempted
  */
 static int
@@ -2574,12 +2578,13 @@ connect_topology (struct GNUNET_TESTING_PeerGroup *pg,
  * by the topology.  This will only have an effect once peers
  * are started if the FRIENDS_ONLY option is set in the base
  * config.  Also takes an optional restrict topology which
- * disallows connections based on a particular transport
+ * disallows connections based on particular transports
  * UNLESS they are specified in the restricted topology.
  *
  * @param pg the peer group struct representing the running peers
  * @param topology which topology to connect the peers in
- * @param restrict_topology allow only direct TCP connections in this topology
+ * @param restrict_topology disallow restrict_transports transport
+ *                          connections to peers NOT in this topology
  *                          use GNUNET_TESTING_TOPOLOGY_NONE for no restrictions
  * @param restrict_transports space delimited list of transports to blacklist
  *                            to create restricted topology
@@ -3630,7 +3635,10 @@ stats_check_existing (struct GNUNET_TESTING_PeerGroup *pg,
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_number (specific_peer->cfg, "statistics",
                                              "port", &port))
-    return GNUNET_NO;
+    {
+      GNUNET_free(unix_domain_socket);
+      return GNUNET_NO;
+    }
 
   if (specific_peer->daemon->hostname != NULL)
     GNUNET_asprintf (&to_match, "%s%s%llu", specific_peer->daemon->hostname,
@@ -3904,6 +3912,7 @@ internal_hostkey_callback (void *cls,
  *
  * @param cls closure
  * @param id identifier for the daemon, NULL on error
+ * @param cfg config
  * @param d handle for the daemon
  * @param emsg error message (NULL on success)
  */