REST/NAMESTORE: rework API
[oweals/gnunet.git] / src / arm / arm_monitor_api.c
index 1f23c1dc5e5091d30d27d6e22885dbca2e42e41e..15f91c036d5473dbf1b6f501cabd87fccaa80f6d 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
 */
 
 /**
@@ -131,10 +131,10 @@ reconnect_arm_monitor_later (struct GNUNET_ARM_MonitorHandle *h)
  */
 static int
 check_monitor_notify (void *cls,
-                       const struct GNUNET_ARM_StatusMessage *res)
+                       const struct GNUNET_ARM_StatusMessage *msg)
 {
-  size_t sl = ntohs (res->header.size) - sizeof (struct GNUNET_ARM_StatusMessage);
-  const char *name = (const char *) &res[1];
+  size_t sl = ntohs (msg->header.size) - sizeof (struct GNUNET_ARM_StatusMessage);
+  const char *name = (const char *) &msg[1];
 
   if ( (0 == sl) ||
        ('\0' != name[sl-1]) )
@@ -150,7 +150,7 @@ check_monitor_notify (void *cls,
  * Handler for notification messages received from ARM.
  *
  * @param cls our `struct GNUNET_ARM_MonitorHandle`
- * @param msg the message received from the arm service
+ * @param res the message received from the arm service
  */
 static void
 handle_monitor_notify (void *cls,
@@ -198,18 +198,18 @@ mq_error_handler (void *cls,
 static int
 reconnect_arm_monitor (struct GNUNET_ARM_MonitorHandle *h)
 {
-  GNUNET_MQ_hd_var_size (monitor_notify,
-                         GNUNET_MESSAGE_TYPE_ARM_STATUS,
-                         struct GNUNET_ARM_StatusMessage);
   struct GNUNET_MQ_MessageHandler handlers[] = {
-    make_monitor_notify_handler (h),
+    GNUNET_MQ_hd_var_size (monitor_notify,
+                           GNUNET_MESSAGE_TYPE_ARM_STATUS,
+                           struct GNUNET_ARM_StatusMessage,
+                           h),
     GNUNET_MQ_handler_end ()
   };
   struct GNUNET_MessageHeader *msg;
   struct GNUNET_MQ_Envelope *env;
 
   GNUNET_assert (NULL == h->mq);
-  h->mq = GNUNET_CLIENT_connecT (h->cfg,
+  h->mq = GNUNET_CLIENT_connect (h->cfg,
                                  "arm",
                                  handlers,
                                  &mq_error_handler,