-only trigger check config if we actually need it
[oweals/gnunet.git] / src / fs / fs_api.h
index 157662a65b52b5ae51417690e08003cdf152a20c..0e1476f5c9c8a5fc81c69c48b59a760602aa9552 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
 */
 
 /**
@@ -601,7 +601,7 @@ struct GNUNET_FS_SearchResult
    * complete on time (and that will need to be cancelled if we clean
    * up the search result before then).
    */
-  GNUNET_SCHEDULER_TaskIdentifier probe_cancel_task;
+  struct GNUNET_SCHEDULER_Task * probe_cancel_task;
 
   /**
    * When did the current probe become active?
@@ -757,11 +757,9 @@ GNUNET_FS_search_probe_progress_ (void *cls,
  * Main function that performs the upload.
  *
  * @param cls `struct GNUNET_FS_PublishContext` identifies the upload
- * @param tc task context
  */
 void
-GNUNET_FS_publish_main_ (void *cls,
-                         const struct GNUNET_SCHEDULER_TaskContext *tc);
+GNUNET_FS_publish_main_ (void *cls);
 
 
 /**
@@ -828,11 +826,9 @@ GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi,
  * request for the file.
  *
  * @param cls the 'struct GNUNET_FS_DownloadContext'
- * @param tc scheduler context
  */
 void
-GNUNET_FS_download_start_task_ (void *cls,
-                                const struct GNUNET_SCHEDULER_TaskContext *tc);
+GNUNET_FS_download_start_task_ (void *cls);
 
 
 
@@ -1170,13 +1166,13 @@ struct GNUNET_FS_Handle
    * Task that processes the jobs in the running and pending queues
    * (and moves jobs around as needed).
    */
-  GNUNET_SCHEDULER_TaskIdentifier queue_job;
+  struct GNUNET_SCHEDULER_Task * queue_job;
 
   /**
    * Task we use to report periodically to the application that
    * certain search probes (from @e probes_head) are still running.
    */
-  GNUNET_SCHEDULER_TaskIdentifier probe_ping_task;
+  struct GNUNET_SCHEDULER_Task * probe_ping_task;
 
   /**
    * Average time we take for a single request to be satisfied.
@@ -1300,7 +1296,7 @@ struct GNUNET_FS_PublishContext
    * ID of the task performing the upload. NO_TASK if the upload has
    * completed.
    */
-  GNUNET_SCHEDULER_TaskIdentifier upload_task;
+  struct GNUNET_SCHEDULER_Task * upload_task;
 
   /**
    * Storage space to reserve for the operation.
@@ -1324,6 +1320,12 @@ struct GNUNET_FS_PublishContext
    */
   int rid;
 
+  /**
+   * Set to #GNUNET_YES if we were able to publish any block.
+   * (and thus unindexing on error might make sense).
+   */
+  int any_done;
+
   /**
    * Set to #GNUNET_YES if all processing has completed.
    */
@@ -1472,11 +1474,6 @@ struct GNUNET_FS_UnindexContext
    */
   struct GNUNET_HashCode uquery;
 
-  /**
-   * First content UID, 0 for none.
-   */
-  uint64_t first_uid;
-
   /**
    * Error message, NULL on success.
    */
@@ -1487,6 +1484,11 @@ struct GNUNET_FS_UnindexContext
    */
   struct GNUNET_CRYPTO_FileHashContext *fhc;
 
+  /**
+   * Which values have we seen already?
+   */
+  struct GNUNET_CONTAINER_MultiHashMap *seen_dh;
+
   /**
    * Overall size of the file.
    */
@@ -1629,10 +1631,10 @@ struct GNUNET_FS_SearchContext
   /**
    * ID of a task that is using this struct and that must be cancelled
    * when the search is being stopped (if not
-   * #GNUNET_SCHEDULER_NO_TASK).  Used for the task that adds some
+   * NULL).  Used for the task that adds some
    * artificial delay when trying to reconnect to the FS service.
    */
-  GNUNET_SCHEDULER_TaskIdentifier task;
+  struct GNUNET_SCHEDULER_Task *task;
 
   /**
    * How many of the entries in the search request
@@ -1961,12 +1963,12 @@ struct GNUNET_FS_DownloadContext
   /**
    * ID of a task that is using this struct and that must be cancelled
    * when the download is being stopped (if not
-   * #GNUNET_SCHEDULER_NO_TASK).  Used for the task that adds some
+   * NULL).  Used for the task that adds some
    * artificial delay when trying to reconnect to the FS service or
    * the task processing incrementally the data on disk, or the
    * task requesting blocks, etc.
    */
-  GNUNET_SCHEDULER_TaskIdentifier task;
+  struct GNUNET_SCHEDULER_Task *task;
 
   /**
    * What is the first offset that we're interested