REST/NAMESTORE: rework API
[oweals/gnunet.git] / src / arm / arm_api.c
index 5c4a1c794184dc1e4526092d07b3f61ceb153024..c8103c877e7d4eb31e1b8386aaf8e2b2c8df3372 100644 (file)
@@ -2,20 +2,20 @@
      This file is part of GNUnet.
      Copyright (C) 2009, 2010, 2012, 2013, 2016 GNUnet e.V.
 
-     GNUnet is free software; you can redistribute it and/or modify
-     it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 3, or (at your
-     option) any later version.
+     GNUnet is free software: you can redistribute it and/or modify it
+     under the terms of the GNU Affero General Public License as published
+     by the Free Software Foundation, either version 3 of the License,
+     or (at your option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
      WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-     General Public License for more details.
+     Affero General Public License for more details.
+    
+     You should have received a copy of the GNU Affero General Public License
+     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-     You should have received a copy of the GNU General Public License
-     along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-     Boston, MA 02110-1301, USA.
+     SPDX-License-Identifier: AGPL3.0-or-later
 */
 
 /**
@@ -463,7 +463,7 @@ reconnect_arm (struct GNUNET_ARM_Handle *h)
                            struct GNUNET_ARM_ListResultMessage,
                            h),
     GNUNET_MQ_hd_fixed_size (confirm,
-                             GNUNET_MESSAGE_TYPE_TEST,
+                             GNUNET_MESSAGE_TYPE_ARM_TEST,
                              struct GNUNET_MessageHeader,
                              h),
     GNUNET_MQ_handler_end ()
@@ -474,7 +474,7 @@ reconnect_arm (struct GNUNET_ARM_Handle *h)
   if (NULL != h->mq)
     return GNUNET_OK;
   GNUNET_assert (GNUNET_NO == h->currently_up);
-  h->mq = GNUNET_CLIENT_connecT (h->cfg,
+  h->mq = GNUNET_CLIENT_connect (h->cfg,
                                  "arm",
                                  handlers,
                                  &mq_error_handler,
@@ -491,7 +491,7 @@ reconnect_arm (struct GNUNET_ARM_Handle *h)
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Sending TEST message to ARM\n");
   env = GNUNET_MQ_msg (test,
-                       GNUNET_MESSAGE_TYPE_TEST);
+                       GNUNET_MESSAGE_TYPE_ARM_TEST);
   GNUNET_MQ_send (h->mq,
                   env);
   return GNUNET_OK;
@@ -602,12 +602,18 @@ start_arm_service (struct GNUNET_ARM_Handle *h,
                                              "PREFIX",
                                              &loprefix))
     loprefix = GNUNET_strdup ("");
+  else
+    loprefix = GNUNET_CONFIGURATION_expand_dollar (h->cfg,
+                                                   loprefix);
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_string (h->cfg,
                                              "arm",
                                              "OPTIONS",
                                              &lopostfix))
     lopostfix = GNUNET_strdup ("");
+  else
+    lopostfix = GNUNET_CONFIGURATION_expand_dollar (h->cfg,
+                                                    lopostfix);
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_string (h->cfg,
                                              "arm",
@@ -676,7 +682,8 @@ start_arm_service (struct GNUNET_ARM_Handle *h,
                                         loprefix,
                                         quotedbinary,
                                         "-d", /* do daemonize */
-                                        lopostfix, NULL);
+                                        lopostfix,
+                                       NULL);
     else
       proc = GNUNET_OS_start_process_s (GNUNET_NO,
                                         std_inheritance,
@@ -747,7 +754,7 @@ change_service (struct GNUNET_ARM_Handle *h,
 
   slen = strlen (service_name) + 1;
   if (slen + sizeof (struct GNUNET_ARM_Message) >=
-      GNUNET_SERVER_MAX_MESSAGE_SIZE)
+      GNUNET_MAX_MESSAGE_SIZE)
   {
     GNUNET_break (0);
     return NULL;