gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r10726 - gnunet/src/testing


From: gnunet
Subject: [GNUnet-SVN] r10726 - gnunet/src/testing
Date: Wed, 31 Mar 2010 12:05:16 +0200

Author: nevans
Date: 2010-03-31 12:05:16 +0200 (Wed, 31 Mar 2010)
New Revision: 10726

Modified:
   gnunet/src/testing/testing_group.c
Log:
change hostname in config files when created, if running remotely... Otherwise 
the testing controller doesn't know whom to connect to.  Since these daemons 
are ostensibly running on said remote hosts, changing the hostname shouldn't 
pose a problem (unless it does)

Modified: gnunet/src/testing/testing_group.c
===================================================================
--- gnunet/src/testing/testing_group.c  2010-03-31 09:22:02 UTC (rev 10725)
+++ gnunet/src/testing/testing_group.c  2010-03-31 10:05:16 UTC (rev 10726)
@@ -164,6 +164,7 @@
 {
   struct GNUNET_CONFIGURATION_Handle *ret;
   unsigned int nport;
+  const char *hostname;
 };
 
 
@@ -205,6 +206,12 @@
       GNUNET_snprintf (cval, sizeof (cval), "%u", ctx->nport++);
       value = cval;
     }
+
+  if ((0 == strcmp (option, "HOSTNAME")) && (ctx->hostname != NULL))
+    {
+      GNUNET_CONFIGURATION_set_value_string (ctx->ret, section, option, 
ctx->hostname);
+    }
+
   GNUNET_CONFIGURATION_set_value_string (ctx->ret, section, option, value);
 }
 
@@ -221,7 +228,7 @@
  * @return new configuration, NULL on error
  */
 static struct GNUNET_CONFIGURATION_Handle *
-make_config (const struct GNUNET_CONFIGURATION_Handle *cfg, uint16_t * port)
+make_config (const struct GNUNET_CONFIGURATION_Handle *cfg, uint16_t * port, 
const char *hostname)
 {
   struct UpdateContext uc;
   uint16_t orig;
@@ -231,6 +238,7 @@
   orig = *port;
   uc.nport = *port;
   uc.ret = GNUNET_CONFIGURATION_create ();
+  uc.hostname = hostname;
 
   GNUNET_CONFIGURATION_iterate (cfg, &update_config, &uc);
   if (uc.nport >= HIGH_PORT)
@@ -1251,12 +1259,12 @@
       if (hostcnt > 0)
         {
           hostname = pg->hosts[off % hostcnt].hostname;
-          pcfg = make_config (cfg, &pg->hosts[off % hostcnt].minport);
+          pcfg = make_config (cfg, &pg->hosts[off % hostcnt].minport, 
hostname);
         }
       else
         {
           hostname = NULL;
-          pcfg = make_config (cfg, &minport);
+          pcfg = make_config (cfg, &minport, hostname);
         }
       if (NULL == pcfg)
         {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]