From: Christian Grothoff Date: Wed, 2 Sep 2009 19:55:10 +0000 (+0000) Subject: finishing first run at unindex X-Git-Tag: initial-import-from-subversion-38251~23537 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=586cf79331064d131c90df08e2d51215214a37d2;p=oweals%2Fgnunet.git finishing first run at unindex --- diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c index a6d414f09..2d16e9aee 100644 --- a/src/fs/fs_unindex.c +++ b/src/fs/fs_unindex.c @@ -144,29 +144,6 @@ unindex_process (void *cls, uc, GNUNET_CONSTANTS_SERVICE_TIMEOUT); } - - -/** - * Function called with information about our - * progress in computing the tree encoding. - * - * @param cls closure - * @param offset where are we in the file - * @param pt_block plaintext of the currently processed block - * @param pt_size size of pt_block - * @param depth depth of the block in the tree - */ -static void -unindex_progress (void *cls, - uint64_t offset, - const void *pt_block, - size_t pt_size, - unsigned int depth) -{ - struct GNUNET_FS_UnindexContext *uc = cls; - // FIXME: call callback! -} - /** @@ -194,6 +171,38 @@ make_unindex_status (struct GNUNET_FS_ProgressInfo *pi, } +/** + * Function called with information about our + * progress in computing the tree encoding. + * + * @param cls closure + * @param offset where are we in the file + * @param pt_block plaintext of the currently processed block + * @param pt_size size of pt_block + * @param depth depth of the block in the tree + */ +static void +unindex_progress (void *cls, + uint64_t offset, + const void *pt_block, + size_t pt_size, + unsigned int depth) +{ + struct GNUNET_FS_UnindexContext *uc = cls; + struct GNUNET_FS_ProgressInfo pi; + + pi.status = GNUNET_FS_STATUS_UNINDEX_PROGRESS; + make_unindex_status (&pi, uc, offset); + pi.value.unindex.specifics.progress.data = pt_block; + pi.value.unindex.specifics.progress.offset = offset; + pi.value.unindex.specifics.progress.data_len = pt_size; + pi.value.unindex.specifics.progress.depth = depth; + uc->client_info + = uc->h->upcb (uc->h->upcb_cls, + &pi); +} + + /** * We've encountered an error during * unindexing. Signal the client. diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index 8f7c67407..e8b8d0ba0 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h @@ -919,6 +919,14 @@ struct GNUNET_FS_ProgressInfo */ uint64_t data_len; + /** + * Depth of the given block in the tree; + * 0 would be the highest level (the first + * call is guaranteed to be for the lowest + * level). + */ + unsigned int depth; + /** * Amount of trust we offered to get the block. */ @@ -1327,6 +1335,14 @@ struct GNUNET_FS_ProgressInfo */ uint64_t data_len; + /** + * Depth of the given block in the tree; + * 0 would be the highest level (the first + * call is guaranteed to be for the lowest + * level). + */ + unsigned int depth; + } progress; /**