tolerate additional IPv4 address now available for gnunet.org
[oweals/gnunet.git] / src / fs / gnunet-daemon-fsprofiler.c
index 326178df9004c6c3c7a9650f9b0ea17a364318fb..0202dde9ce6097c21b552dcdf11f16f305dc547c 100644 (file)
@@ -2,20 +2,20 @@
      This file is part of GNUnet.
      Copyright (C) 2012 Christian Grothoff
 
-     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
 */
 
 /**
@@ -246,7 +246,7 @@ make_file (uint64_t length,
   for (i=0;i<length; i+=8)
   {
     xor = length ^ kval ^ (uint64_t) (i / 32 / 1024);
-    memcpy (&data[i], &xor, GNUNET_MIN (length - i, sizeof (uint64_t)));
+    GNUNET_memcpy (&data[i], &xor, GNUNET_MIN (length - i, sizeof (uint64_t)));
   }
   bo.expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_DAYS);
   bo.anonymity_level = (uint32_t) anonymity_level;
@@ -500,12 +500,8 @@ start_publish (void *cls)
 {
   struct Pattern *p = cls;
   struct GNUNET_FS_FileInformation *fi;
-  const struct GNUNET_SCHEDULER_TaskContext *tc;
 
   p->task = NULL;
-  tc = GNUNET_SCHEDULER_get_task_context ();
-  if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
-    return;
   fi = make_file (p->x, p->y, p);
   p->start_time = GNUNET_TIME_absolute_get ();
   p->ctx = GNUNET_FS_publish_start (fs_handle,
@@ -525,12 +521,8 @@ start_download (void *cls)
 {
   struct Pattern *p = cls;
   struct GNUNET_FS_Uri *keywords;
-  const struct GNUNET_SCHEDULER_TaskContext *tc;
 
   p->task = NULL;
-  tc = GNUNET_SCHEDULER_get_task_context ();
-  if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
-    return;
   keywords = make_keywords (p->x);
   p->start_time = GNUNET_TIME_absolute_get ();
   p->sctx = GNUNET_FS_search_start (fs_handle, keywords,
@@ -558,8 +550,8 @@ run (void *cls, char *const *args GNUNET_UNUSED,
 
   cfg = cfg_;
   /* Scheduled the task to clean up when shutdown is called */
-  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
-                                NULL);
+  GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
+                                NULL);
 
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_number (cfg,