{
struct GNUNET_CONFIGURATION_Handle *ret;
unsigned int nport;
+ const char *hostname;
};
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);
}
* @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;
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)
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)
{