-keep track of messages passed to mq
[oweals/gnunet.git] / src / sensor / gnunet-service-sensor_update.c
index cbc63308de41de56b8f4ba836ec55081831858d8..b2c8b21d40226646775f29aa95a8e352b940150a 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C)
+     Copyright (C)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -14,8 +14,8 @@
 
      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., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 
 /**
@@ -168,12 +168,12 @@ static int updating;
 /**
  * GNUnet scheduler task that starts the update check process.
  */
-GNUNET_SCHEDULER_TaskIdentifier update_task;
+static struct GNUNET_SCHEDULER_Task * update_task;
 
 /**
  * Pointer to service reset function called when we have new sensor updates.
  */
-void (*reset_cb) ();
+static void (*reset_cb) ();
 
 
 /**
@@ -237,10 +237,10 @@ SENSOR_update_stop ()
 
   up_default = NULL;
   up = up_head;
-  if (GNUNET_SCHEDULER_NO_TASK != update_task)
+  if (NULL != update_task)
   {
     GNUNET_SCHEDULER_cancel (update_task);
-    update_task = GNUNET_SCHEDULER_NO_TASK;
+    update_task = NULL;
   }
   while (NULL != up)
   {
@@ -390,7 +390,7 @@ check_for_updates (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   struct GNUNET_MessageHeader *msg;
   size_t msg_size;
 
-  update_task = GNUNET_SCHEDULER_NO_TASK;
+  update_task = NULL;
   if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
     return;
   if (GNUNET_YES == updating)
@@ -452,8 +452,8 @@ load_update_points ()
   int count = 0;
 
   if (GNUNET_OK !=
-      GNUNET_CONFIGURATION_get_value_string (cfg, "sensor", "UPDATE_POINTS",
-                                             &points_list))
+      GNUNET_CONFIGURATION_get_value_string (cfg, "sensor-update",
+                                             "UPDATE_POINTS", &points_list))
   {
     return 0;
   }
@@ -646,7 +646,7 @@ update_sensor (char *sensorname, void *sensorfile, uint16_t sensorfile_size,
  * @param cls unused
  * @param tc unused
  */
-void
+static void
 reset (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   reset_cb ();
@@ -710,7 +710,7 @@ handle_sensor_full (void *cls, struct GNUNET_CADET_Channel *channel,
   {
     updating = GNUNET_NO;
     cleanup_updatepoint (up_default);
-    GNUNET_SCHEDULER_add_continuation (&reset, NULL, 0);
+    GNUNET_SCHEDULER_add_now (&reset, NULL);
   }
   else
     GNUNET_CADET_receive_done (channel);