/* obtain configuration */
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg, sl->name, "PREFIX",
- &loprefix))
+ GNUNET_CONFIGURATION_get_value_string (cfg,
+ sl->name,
+ "PREFIX",
+ &loprefix))
loprefix = GNUNET_strdup (prefix_command);
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg, sl->name, "OPTIONS",
- &options))
+ GNUNET_CONFIGURATION_get_value_string (cfg,
+ sl->name,
+ "OPTIONS",
+ &options))
+ options = NULL;
+
+ {
+ char *new_options;
+ char *optpos;
+ char *fin_options;
+
+ fin_options = GNUNET_strdup (final_option);
+ /* replace '{}' with service name */
+ while (NULL != (optpos = strstr (fin_options, "{}")))
+ {
+ /* terminate string at opening parenthesis */
+ *optpos = 0;
+ GNUNET_asprintf (&new_options,
+ "%s%s%s",
+ fin_options,
+ sl->name,
+ optpos + 2);
+ GNUNET_free (fin_options);
+ fin_options = new_options;
+ }
+ if (NULL != options)
{
- char *new_options;
- char *optpos;
- options = GNUNET_strdup (final_option);
- /* replace '{}' with service name */
- while (NULL != (optpos = strstr (options, "{}")))
- {
- /* terminate string at opening parenthesis */
- *optpos = 0;
- GNUNET_asprintf (&new_options, "%s%s%s", options, sl->name, optpos + 2);
- GNUNET_free (options);
- options = new_options;
- }
- options = GNUNET_CONFIGURATION_expand_dollar (cfg, options);
+ /* combine "fin_options" with "options" */
+ optpos = options;
+ GNUNET_asprintf (&options,
+ "%s %s",
+ fin_options,
+ optpos);
+ GNUNET_free (optpos);
}
- use_debug = GNUNET_CONFIGURATION_get_value_yesno (cfg, sl->name, "DEBUG");
-
+ else
+ {
+ /* only have "fin_options", use that */
+ options = fin_options;
+ }
+ }
+ options = GNUNET_CONFIGURATION_expand_dollar (cfg,
+ options);
+ use_debug = GNUNET_CONFIGURATION_get_value_yesno (cfg,
+ sl->name,
+ "DEBUG");
{
const char *service_type = NULL;
const char *choices[] = { "GNUNET", "SIMPLE", NULL };
+
is_simple_service = GNUNET_NO;
if ( (GNUNET_OK ==
- GNUNET_CONFIGURATION_get_value_choice (cfg,
- sl->name,
- "TYPE",
- choices,
- &service_type)) &&
+ GNUNET_CONFIGURATION_get_value_choice (cfg,
+ sl->name,
+ "TYPE",
+ choices,
+ &service_type)) &&
(0 == strcasecmp (service_type, "SIMPLE")) )
is_simple_service = GNUNET_YES;
}
sl->proc =
GNUNET_OS_start_process_s (sl->pipe_control,
GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
- lsocks, loprefix, quotedbinary,
- options, NULL);
+ lsocks,
+ loprefix,
+ quotedbinary,
+ options,
+ NULL);
}
else
{
sl->proc =
GNUNET_OS_start_process_s (sl->pipe_control,
GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
- lsocks, loprefix, quotedbinary, "-L",
- "DEBUG", options, NULL);
+ lsocks,
+ loprefix,
+ quotedbinary,
+ "-L", "DEBUG",
+ options,
+ NULL);
else
sl->proc =
GNUNET_OS_start_process_s (sl->pipe_control,
GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
- lsocks, loprefix, quotedbinary, "-c",
- sl->config, "-L",
- "DEBUG", options, NULL);
+ lsocks,
+ loprefix,
+ quotedbinary,
+ "-c", sl->config,
+ "-L", "DEBUG",
+ options,
+ NULL);
}
else
{
sl->proc =
GNUNET_OS_start_process_s (sl->pipe_control,
GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
- lsocks, loprefix, quotedbinary,
- options, NULL);
+ lsocks,
+ loprefix,
+ quotedbinary,
+ options,
+ NULL);
else
sl->proc =
GNUNET_OS_start_process_s (sl->pipe_control,
GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
- lsocks, loprefix, quotedbinary, "-c",
- sl->config, options, NULL);
+ lsocks,
+ loprefix,
+ quotedbinary,
+ "-c", sl->config,
+ options,
+ NULL);
}
}
GNUNET_free (binary);
if (( (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_filename (cfg, section,
"CONFIG",
- &config)) &&
+ &config)) &&
(GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_filename (cfg,
"PATHS",
#if WINDOWS
sl->pipe_control = GNUNET_YES;
#else
- if (GNUNET_CONFIGURATION_have_value (cfg, section, "PIPECONTROL"))
- sl->pipe_control = GNUNET_CONFIGURATION_get_value_yesno (cfg, section, "PIPECONTROL");
+ if (GNUNET_CONFIGURATION_have_value (cfg,
+ section,
+ "PIPECONTROL"))
+ sl->pipe_control = GNUNET_CONFIGURATION_get_value_yesno (cfg,
+ section,
+ "PIPECONTROL");
#endif
GNUNET_CONTAINER_DLL_insert (running_head,
running_tail,
}
#endif
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg, "ARM", "GLOBAL_PREFIX",
- &prefix_command))
+ GNUNET_CONFIGURATION_get_value_string (cfg,
+ "ARM",
+ "GLOBAL_PREFIX",
+ &prefix_command))
prefix_command = GNUNET_strdup ("");
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg, "ARM", "GLOBAL_POSTFIX",
- &final_option))
+ GNUNET_CONFIGURATION_get_value_string (cfg,
+ "ARM",
+ "GLOBAL_POSTFIX",
+ &final_option))
final_option = GNUNET_strdup ("");
if (GNUNET_YES ==
- GNUNET_CONFIGURATION_get_value_yesno (cfg, "ARM", "USER_ONLY"))
+ GNUNET_CONFIGURATION_get_value_yesno (cfg,
+ "ARM",
+ "USER_ONLY"))
{
GNUNET_break (GNUNET_YES == start_user);
start_system = GNUNET_NO;
}
if (GNUNET_YES ==
- GNUNET_CONFIGURATION_get_value_yesno (cfg, "ARM", "SYSTEM_ONLY"))
+ GNUNET_CONFIGURATION_get_value_yesno (cfg,
+ "ARM",
+ "SYSTEM_ONLY"))
{
GNUNET_break (GNUNET_YES == start_system);
start_user = GNUNET_NO;