-only trigger check config if we actually need it
[oweals/gnunet.git] / src / fs / gnunet-service-fs_indexing.c
index 1baab4c6723974c37239db4283b094b6a39f1de8..87de0986d8ca36b414f2c0d020371a87494bb18e 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2009, 2010 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2009, 2010 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.
 */
 
 /**
@@ -236,7 +236,7 @@ signal_index_ok (struct IndexInfo *ii)
                 _
                 ("Index request received for file `%s' is already indexed as `%s'.  Permitting anyway.\n"),
                 ii->filename,
-               ir->filename);           
+               ir->filename);
     GNUNET_SERVER_transmit_context_append_data (ii->tc, NULL, 0,
                                                 GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK);
     GNUNET_SERVER_transmit_context_run (ii->tc, GNUNET_TIME_UNIT_MINUTES);
@@ -468,7 +468,7 @@ GNUNET_FS_handle_unindex (void *cls, struct GNUNET_SERVER_Client *client,
  * @param msg error message
  */
 static void
-remove_cont (void *cls, int success, 
+remove_cont (void *cls, int success,
             struct GNUNET_TIME_Absolute min_expiration,
             const char *msg)
 {
@@ -508,8 +508,8 @@ GNUNET_FS_handle_on_demand_block (const struct GNUNET_HashCode * key, uint32_t s
 {
   const struct OnDemandBlock *odb;
   struct GNUNET_HashCode nkey;
-  struct GNUNET_CRYPTO_AesSessionKey skey;
-  struct GNUNET_CRYPTO_AesInitializationVector iv;
+  struct GNUNET_CRYPTO_SymmetricSessionKey skey;
+  struct GNUNET_CRYPTO_SymmetricInitializationVector iv;
   struct GNUNET_HashCode query;
   ssize_t nsize;
   char ndata[DBLOCK_SIZE];
@@ -523,7 +523,7 @@ GNUNET_FS_handle_on_demand_block (const struct GNUNET_HashCode * key, uint32_t s
   {
     GNUNET_break (0);
     GNUNET_DATASTORE_remove (dsh, key, size, data, -1, -1,
-                             GNUNET_TIME_UNIT_FOREVER_REL, &remove_cont, NULL);
+                             &remove_cont, NULL);
     return GNUNET_SYSERR;
   }
   odb = (const struct OnDemandBlock *) data;
@@ -542,7 +542,7 @@ GNUNET_FS_handle_on_demand_block (const struct GNUNET_HashCode * key, uint32_t s
                               ("# index blocks removed: original file inaccessible"),
                               1, GNUNET_YES);
     GNUNET_DATASTORE_remove (dsh, key, size, data, -1, -1,
-                             GNUNET_TIME_UNIT_FOREVER_REL, &remove_cont, NULL);
+                             &remove_cont, NULL);
     return GNUNET_SYSERR;
   }
   if ((NULL ==
@@ -560,13 +560,13 @@ GNUNET_FS_handle_on_demand_block (const struct GNUNET_HashCode * key, uint32_t s
     if (fh != NULL)
       GNUNET_DISK_file_close (fh);
     GNUNET_DATASTORE_remove (dsh, key, size, data, -1, -1,
-                             GNUNET_TIME_UNIT_FOREVER_REL, &remove_cont, NULL);
+                             &remove_cont, NULL);
     return GNUNET_SYSERR;
   }
   GNUNET_DISK_file_close (fh);
   GNUNET_CRYPTO_hash (ndata, nsize, &nkey);
   GNUNET_CRYPTO_hash_to_aes_key (&nkey, &skey, &iv);
-  GNUNET_CRYPTO_aes_encrypt (ndata, nsize, &skey, &iv, edata);
+  GNUNET_CRYPTO_symmetric_encrypt (ndata, nsize, &skey, &iv, edata);
   GNUNET_CRYPTO_hash (edata, nsize, &query);
   if (0 != memcmp (&query, key, sizeof (struct GNUNET_HashCode)))
   {
@@ -574,7 +574,7 @@ GNUNET_FS_handle_on_demand_block (const struct GNUNET_HashCode * key, uint32_t s
                 _("Indexed file `%s' changed at offset %llu\n"), fn,
                 (unsigned long long) off);
     GNUNET_DATASTORE_remove (dsh, key, size, data, -1, -1,
-                             GNUNET_TIME_UNIT_FOREVER_REL, &remove_cont, NULL);
+                             &remove_cont, NULL);
     return GNUNET_SYSERR;
   }
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,