From: Christian Grothoff Date: Mon, 19 Oct 2009 14:07:56 +0000 (+0000) Subject: fix (bad argument order), plus some more debug statements for now X-Git-Tag: initial-import-from-subversion-38251~23318 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=11ce3736a27e5f9082411eea577c05c58ad2793b;p=oweals%2Fgnunet.git fix (bad argument order), plus some more debug statements for now --- diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c index 72bbfdfa9..145b7605c 100644 --- a/src/fs/fs_publish.c +++ b/src/fs/fs_publish.c @@ -26,7 +26,6 @@ * @author Christian Grothoff * * TODO: - * - code-sharing with unindex (write unindex code) * - indexing cleanup: unindex on failure (can wait) * - persistence support (can wait) * - datastore reservation support (optimization) @@ -485,9 +484,10 @@ block_proc (void *cls, #if DEBUG_PUBLISH GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Publishing block `%s' for offset %llu\n", + "Publishing block `%s' for offset %llu with size %u\n", GNUNET_h2s (query), - (unsigned long long) offset); + (unsigned long long) offset, + (unsigned int) block_size); #endif p = sc->fi_pos; if (NULL == sc->dsh) diff --git a/src/fs/fs_tree.c b/src/fs/fs_tree.c index 3dbf478df..047fdd332 100644 --- a/src/fs/fs_tree.c +++ b/src/fs/fs_tree.c @@ -31,6 +31,7 @@ #include "platform.h" #include "fs_tree.h" +#define DEBUG_TREE GNUNET_YES /** * Context for an ECRS-based file encoder that computes @@ -316,6 +317,14 @@ void GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder * te) } off = compute_chk_offset (te->chk_tree_depth - te->current_depth, te->publish_offset); +#if DEBUG_TREE + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "TE is at offset %llu and depth %u with block size %u and target-CHK-offset %u\n", + (unsigned long long) te->publish_offset, + te->current_depth, + (unsigned int) pt_size, + (unsigned int) off); +#endif mychk = &te->chk_tree[(te->current_depth-1)*CHK_PER_INODE+off]; GNUNET_CRYPTO_hash (pt_block, pt_size, &mychk->key); GNUNET_CRYPTO_hash_to_aes_key (&mychk->key, &sk, &iv); @@ -324,22 +333,27 @@ void GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder * te) &sk, &iv, enc); + GNUNET_CRYPTO_hash (enc, pt_size, &mychk->query); +#if DEBUG_TREE + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "TE calculates query to be `%s'\n", + GNUNET_h2s (&mychk->query)); +#endif if (NULL != te->proc) te->proc (te->cls, &mychk->query, te->publish_offset, - pt_size, - enc, (te->current_depth == te->chk_tree_depth) ? GNUNET_DATASTORE_BLOCKTYPE_DBLOCK - : GNUNET_DATASTORE_BLOCKTYPE_IBLOCK); + : GNUNET_DATASTORE_BLOCKTYPE_IBLOCK, + enc, + pt_size); if (NULL != te->progress) te->progress (te->cls, te->publish_offset, pt_block, pt_size, te->current_depth); - GNUNET_CRYPTO_hash (enc, pt_size, &mychk->query); if (te->current_depth == te->chk_tree_depth) { te->publish_offset += pt_size;