-only trigger check config if we actually need it
[oweals/gnunet.git] / src / fs / gnunet-service-fs_cadet_server.c
index 6ce18afb5593686820c5290ab3ae467525d00875..c9d838fefc6d0c1b4e7079879881d33db14a0962 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2012, 2013 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2012, 2013 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
@@ -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.
 */
 
 /**
@@ -108,12 +108,12 @@ struct CadetClient
   /**
    * Task that is scheduled to asynchronously terminate the connection.
    */
-  GNUNET_SCHEDULER_TaskIdentifier terminate_task;
+  struct GNUNET_SCHEDULER_Task * terminate_task;
 
   /**
    * Task that is scheduled to terminate idle connections.
    */
-  GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+  struct GNUNET_SCHEDULER_Task * timeout_task;
 
   /**
    * Size of the last write that was initiated.
@@ -154,16 +154,14 @@ static unsigned long long sc_count_max;
  * Task run to asynchronously terminate the cadet due to timeout.
  *
  * @param cls the 'struct CadetClient'
- * @param tc scheduler context
  */
 static void
-timeout_cadet_task (void *cls,
-                    const struct GNUNET_SCHEDULER_TaskContext *tc)
+timeout_cadet_task (void *cls)
 {
   struct CadetClient *sc = cls;
   struct GNUNET_CADET_Channel *tun;
 
-  sc->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+  sc->timeout_task = NULL;
   tun = sc->channel;
   sc->channel = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -181,7 +179,7 @@ timeout_cadet_task (void *cls,
 static void
 refresh_timeout_task (struct CadetClient *sc)
 {
-  if (GNUNET_SCHEDULER_NO_TASK != sc->timeout_task)
+  if (NULL != sc->timeout_task)
     GNUNET_SCHEDULER_cancel (sc->timeout_task);
   sc->timeout_task = GNUNET_SCHEDULER_add_delayed (IDLE_TIMEOUT,
                                                   &timeout_cadet_task,
@@ -324,7 +322,7 @@ continue_writing (struct CadetClient *sc)
 static void
 handle_datastore_reply (void *cls,
                        const struct GNUNET_HashCode *key,
-                       size_t size, 
+                       size_t size,
                        const void *data,
                        enum GNUNET_BLOCK_Type type,
                        uint32_t priority,
@@ -447,7 +445,6 @@ request_cb (void *cls,
                                     ntohl (sqm->type),
                                     0 /* priority */,
                                     GSF_datastore_queue_size,
-                                    GNUNET_TIME_UNIT_FOREVER_REL,
                                     &handle_datastore_reply, sc);
   if (NULL == sc->qe)
   {
@@ -530,9 +527,9 @@ cleaner_cb (void *cls,
   GNUNET_STATISTICS_update (GSF_stats,
                            gettext_noop ("# cadet connections active"), -1,
                            GNUNET_NO);
-  if (GNUNET_SCHEDULER_NO_TASK != sc->terminate_task)
+  if (NULL != sc->terminate_task)
     GNUNET_SCHEDULER_cancel (sc->terminate_task);
-  if (GNUNET_SCHEDULER_NO_TASK != sc->timeout_task)
+  if (NULL != sc->timeout_task)
     GNUNET_SCHEDULER_cancel (sc->timeout_task);
   if (NULL != sc->wh)
     GNUNET_CADET_notify_transmit_ready_cancel (sc->wh);