0.9.0pre1:
* FS: [CG]
- - support recursive download even if filename is NULL and we hence
- do not generate files on disk (use temp_filename)
- bound parallelism (# fs downloads)
- distinguish in performance tracking and event signalling between
downloads that are actually running and those that are merely in the queue
- persistence support (publish, unindex, search, download)
- active migration support (in fs or in datastore or new daemon?)
- - gnunet-service-fs (hot-path routing, load-based routing, nitpicks)
+ - support for in-line files in directories (FIXME in fs_download)
+ - gnunet-service-fs (hot-path routing, load-based routing, nitpicks)
- [gnunet-service-fs.c:208]: member 'LocalGetContext::results_bf_size' is never used
- [gnunet-service-fs.c:501]: member 'PendingRequest::used_pids_size' is never used
- [gnunet-service-fs.c:654]: member 'ConnectedPeer::last_client_replies' is never used
* MYSQL database backends: [CG]
- datacache
- datastore
+* FS:
+ - reconstruct IBLOCKS from DBLOCKS if possible (during download; see FIXME in fs_download)
+
0.9.0:
* new webpage:
* TODO:
* - handle recursive downloads (need directory &
* fs-level download-parallelism management)
- * - handle recursive downloads where directory file is
- * NOT saved on disk (need temporary file instead then!)
* - location URI suppport (can wait, easy)
* - check if blocks exist already (can wait, easy)
* - check if iblocks can be computed from existing blocks (can wait, hard)
#define DEBUG_DOWNLOAD GNUNET_NO
+/**
+ * Determine if the given download (options and meta data) should cause
+ * use to try to do a recursive download.
+ */
+static int
+is_recursive_download (struct GNUNET_FS_DownloadContext *dc)
+{
+ return (0 != (dc->options & GNUNET_FS_DOWNLOAD_OPTION_RECURSIVE)) &&
+ ( (GNUNET_YES == GNUNET_FS_meta_data_test_for_directory (dc->meta)) ||
+ ( (dc->meta == NULL) &&
+ ( (NULL == dc->filename) ||
+ ( (strlen (dc->filename) >= strlen (GNUNET_FS_DIRECTORY_EXT)) &&
+ (NULL !=
+ strstr (dc->filename + strlen(dc->filename) - strlen(GNUNET_FS_DIRECTORY_EXT),
+ GNUNET_FS_DIRECTORY_EXT)) ) ) ) );
+}
+
+
/**
* We're storing the IBLOCKS after the DBLOCKS on disk (so that we
* only have to truncate the file once we're done).
block,
len)) )
{
- /* FIXME: also check query matches!? */
if (0 == memcmp (&key,
&chk->key,
sizeof (GNUNET_HashCode)))
}
else
{
- /* FIXME: need to initialize (and use) temp_filename
- in various places in order for this assertion to
- not fail; right now, it will always fail! */
GNUNET_assert (dc->temp_filename != NULL);
h = GNUNET_DISK_file_open (dc->temp_filename,
GNUNET_DISK_OPEN_READ,
/* do recursive download if option is set and either meta data
says it is a directory or if no meta data is given AND filename
ends in '.gnd' (top-level case) */
- if ( (0 != (dc->options & GNUNET_FS_DOWNLOAD_OPTION_RECURSIVE)) &&
- ( (GNUNET_YES == GNUNET_FS_meta_data_test_for_directory (dc->meta)) ||
- ( (dc->meta == NULL) &&
- ( (NULL == dc->filename) ||
- ( (strlen (dc->filename) >= strlen (GNUNET_FS_DIRECTORY_EXT)) &&
- (NULL !=
- strstr (dc->filename + strlen(dc->filename) - strlen(GNUNET_FS_DIRECTORY_EXT),
- GNUNET_FS_DIRECTORY_EXT)) ) ) ) ) )
+ if (is_recursive_download (dc))
GNUNET_FS_directory_list_contents (prc->size,
pt,
off,
dc->filename);
}
- if ( (0 != (dc->options & GNUNET_FS_DOWNLOAD_OPTION_RECURSIVE)) &&
- ( (GNUNET_YES == GNUNET_FS_meta_data_test_for_directory (dc->meta)) ||
- ( (dc->meta == NULL) &&
- ( (NULL == dc->filename) ||
- ( (strlen (dc->filename) >= strlen (GNUNET_FS_DIRECTORY_EXT)) &&
- (NULL !=
- strstr (dc->filename + strlen(dc->filename) - strlen(GNUNET_FS_DIRECTORY_EXT),
- GNUNET_FS_DIRECTORY_EXT)) ) ) ) ) )
+ if (is_recursive_download (dc))
full_recursive_download (dc);
if (dc->child_head == NULL)
{
dc->options = options;
dc->active = GNUNET_CONTAINER_multihashmap_create (1 + 2 * (length / DBLOCK_SIZE));
dc->treedepth = GNUNET_FS_compute_depth (GNUNET_ntohll(dc->uri->data.chk.file_length));
+ if ( (filename == NULL) &&
+ (is_recursive_download (dc) ) )
+ dc->temp_filename = GNUNET_DISK_mktemp ("gnunet-directory-download-tmp");
+
#if DEBUG_DOWNLOAD
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Download tree has depth %u\n",
}
GNUNET_CONTAINER_meta_data_destroy (dc->meta);
GNUNET_FS_uri_destroy (dc->uri);
+ if (NULL != dc->temp_filename)
+ {
+ if (0 != UNLINK (dc->temp_filename))
+ GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
+ "unlink",
+ dc->temp_filename);
+ GNUNET_free (dc->temp_filename);
+ }
GNUNET_free (dc);
}