refactor DHT for new service API
[oweals/gnunet.git] / src / arm / gnunet-service-arm.c
index 995cd44895cce402cdb76ffabe652570bdf42c06..5bf82365617def5e01cad88069fc56c356c11535 100644 (file)
@@ -318,9 +318,10 @@ broadcast_status (const char *name,
                  namelen);
   if (NULL == unicast)
   {
-    GNUNET_notification_context_broadcast (notifier,
-                                           &msg->header,
-                                           GNUNET_YES);
+    if (NULL != notifier)
+      GNUNET_notification_context_broadcast (notifier,
+                                             &msg->header,
+                                             GNUNET_YES);
     GNUNET_MQ_discard (env);
   }
   else
@@ -379,18 +380,23 @@ start_process (struct ServiceList *sl,
 
   /* obtain configuration */
   if (GNUNET_OK !=
-      GNUNET_CONFIGURATION_get_value_filename (cfg,
-                                               sl->name,
-                                               "PREFIX",
-                                               &loprefix))
+      GNUNET_CONFIGURATION_get_value_string (cfg,
+                                             sl->name,
+                                             "PREFIX",
+                                             &loprefix))
     loprefix = GNUNET_strdup (prefix_command);
+  else
+    loprefix = GNUNET_CONFIGURATION_expand_dollar (cfg,
+                                                   loprefix);
   if (GNUNET_OK !=
-      GNUNET_CONFIGURATION_get_value_filename (cfg,
-                                               sl->name,
-                                               "OPTIONS",
-                                               &options))
+      GNUNET_CONFIGURATION_get_value_string (cfg,
+                                             sl->name,
+                                             "OPTIONS",
+                                             &options))
     options = NULL;
-
+  else
+    options = GNUNET_CONFIGURATION_expand_dollar (cfg,
+                                                  options);
   {
     char *new_options;
     char *optpos;
@@ -1513,10 +1519,10 @@ setup_service (void *cls,
                        "arm"))
     return;
   if (GNUNET_OK !=
-      GNUNET_CONFIGURATION_get_value_filename (cfg,
-                                               section,
-                                               "BINARY",
-                                               &binary))
+      GNUNET_CONFIGURATION_get_value_string (cfg,
+                                             section,
+                                             "BINARY",
+                                             &binary))
   {
     /* not a service section */
     return;
@@ -1554,7 +1560,8 @@ setup_service (void *cls,
   }
   config = NULL;
   if (( (GNUNET_OK !=
-        GNUNET_CONFIGURATION_get_value_filename (cfg, section,
+        GNUNET_CONFIGURATION_get_value_filename (cfg,
+                                                  section,
                                                   "CONFIG",
                                                   &config)) &&
        (GNUNET_OK !=
@@ -1743,12 +1750,18 @@ run (void *cls,
                                              "GLOBAL_PREFIX",
                                              &prefix_command))
     prefix_command = GNUNET_strdup ("");
+  else
+    prefix_command = GNUNET_CONFIGURATION_expand_dollar (cfg,
+                                                         prefix_command);
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_string (cfg,
                                              "ARM",
                                              "GLOBAL_POSTFIX",
                                              &final_option))
     final_option = GNUNET_strdup ("");
+  else
+    final_option = GNUNET_CONFIGURATION_expand_dollar (cfg,
+                                                       final_option);
   if (GNUNET_YES ==
       GNUNET_CONFIGURATION_get_value_yesno (cfg,
                                             "ARM",