cancel hashing on shutdown
authorChristian Grothoff <christian@grothoff.org>
Tue, 4 Jan 2011 12:59:15 +0000 (12:59 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 4 Jan 2011 12:59:15 +0000 (12:59 +0000)
src/fs/gnunet-service-fs_indexing.c

index 2e95f454f1870b7044a072846ce9e87b830f36b4..363755169fa747fa24520d68395ff001715cfa8f 100644 (file)
  * @file fs/gnunet-service-fs_indexing.c
  * @brief program that provides indexing functions of the file-sharing service
  * @author Christian Grothoff
- *
- * TODO:
- * - consider doing GNUNET_CRYPTO_hash_file_cancel on active indexing
- *   jobs during shutdown (currently, shutdown will only happen after
- *   all of those are done, not sure if this is good or bad)
  */
 #include "platform.h"
 #include <float.h>
@@ -702,6 +697,8 @@ shutdown_task (void *cls,
   while (NULL != (pos = indexed_files))
     {
       indexed_files = pos->next;
+      if (pos->fhc != NULL)
+       GNUNET_CRYPTO_hash_file_cancel (pos->fhc);
       GNUNET_free (pos);
     }
   cfg = NULL;