-
/*
This file is part of GNUnet.
(C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Christian Grothoff (and other contributing authors)
/**
* Maximum number of outgoing messages we queue per peer.
+ *
+ * Performance measurements for 2 peer setup for 50 MB file
+ * (with MAX_DATASTORE_QUEUE = 1 and RETRY_PROBABILITY_INV = 1):
+ *
+ * 2: 1700 kb/s, 1372 kb/s
+ * 8: 2117 kb/s, 1284 kb/s, 1112 kb/s
+ * 16: 3500 kb/s, 3200 kb/s, 3388 kb/s
+ * 32: 3441 kb/s, 3163 kb/s, 3277 kb/s
+ * 128: 1700 kb/s; 2010 kb/s, 3383 kb/s, 1156 kb/s
+ *
+ * Conclusion: 16 seems to be a pretty good value (stable
+ * and high performance, no excessive memory use).
*/
#define MAX_QUEUE_PER_PEER 16
struct GNUNET_FS_DownloadContext *dc);
+/**
+ * Task that creates the initial (top-level) download
+ * 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);
+
+
/**
* Fill in all of the generic fields for
* an unindex event and call the callback.
*/
struct GNUNET_FS_Handle
{
- /**
- * Scheduler.
- */
- struct GNUNET_SCHEDULER_Handle *sched;
-
/**
* Configuration to use.
*/
* when the search is being stopped (if not
* GNUNET_SCHEDULER_NO_TASK). Used for the task that adds some
* artificial delay when trying to reconnect to the FS service.
- */
+o */
GNUNET_SCHEDULER_TaskIdentifier task;
+
+ /**
+ * How many of the entries in the search request
+ * map have been passed to the service so far?
+ */
+ unsigned int search_request_map_offset;
+
+ /**
+ * How many of the keywords in the KSK
+ * map have been passed to the service so far?
+ */
+ unsigned int keyword_offset;
/**
* Anonymity level for the search.
};
+/**
+ * Closure for 'reconstruct_cont' and 'reconstruct_cb'.
+ */
+struct ReconstructContext;
+
+
/**
* Context for controlling a download.
*/
*/
struct GNUNET_FS_DownloadContext *child_tail;
+ /**
+ * State for block reconstruction.
+ */
+ struct ReconstructContext *rcc;
+
/**
* Previous download belonging to the same parent.
*/
*/
GNUNET_SCHEDULER_TaskIdentifier task;
+ /**
+ * Task used to start the download.
+ */
+ GNUNET_SCHEDULER_TaskIdentifier start_task;
+
/**
* What was the size of the file on disk that we're downloading
* before we started? Used to detect if there is a point in
* data from the meta data yet?
*/
int tried_full_data;
+
+ /**
+ * Have we tried to reconstruct an IBLOCK from disk
+ * and failed (and should hence not try again?)
+ */
+ int reconstruct_failed;
};