diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-10-19 14:07:56 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-10-19 14:07:56 +0000 |
commit | 11ce3736a27e5f9082411eea577c05c58ad2793b (patch) | |
tree | 620ba43b7f67020bcabd5670c4e8f9ef523efc70 /src/fs/fs_tree.c | |
parent | 8da608f0e8391f0159c1e8faf43e8085a9309ce0 (diff) | |
download | gnunet-11ce3736a27e5f9082411eea577c05c58ad2793b.tar.gz gnunet-11ce3736a27e5f9082411eea577c05c58ad2793b.zip |
fix (bad argument order), plus some more debug statements for now
Diffstat (limited to 'src/fs/fs_tree.c')
-rw-r--r-- | src/fs/fs_tree.c | 22 |
1 files changed, 18 insertions, 4 deletions
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 @@ | |||
31 | #include "platform.h" | 31 | #include "platform.h" |
32 | #include "fs_tree.h" | 32 | #include "fs_tree.h" |
33 | 33 | ||
34 | #define DEBUG_TREE GNUNET_YES | ||
34 | 35 | ||
35 | /** | 36 | /** |
36 | * Context for an ECRS-based file encoder that computes | 37 | * Context for an ECRS-based file encoder that computes |
@@ -316,6 +317,14 @@ void GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder * te) | |||
316 | } | 317 | } |
317 | off = compute_chk_offset (te->chk_tree_depth - te->current_depth, | 318 | off = compute_chk_offset (te->chk_tree_depth - te->current_depth, |
318 | te->publish_offset); | 319 | te->publish_offset); |
320 | #if DEBUG_TREE | ||
321 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
322 | "TE is at offset %llu and depth %u with block size %u and target-CHK-offset %u\n", | ||
323 | (unsigned long long) te->publish_offset, | ||
324 | te->current_depth, | ||
325 | (unsigned int) pt_size, | ||
326 | (unsigned int) off); | ||
327 | #endif | ||
319 | mychk = &te->chk_tree[(te->current_depth-1)*CHK_PER_INODE+off]; | 328 | mychk = &te->chk_tree[(te->current_depth-1)*CHK_PER_INODE+off]; |
320 | GNUNET_CRYPTO_hash (pt_block, pt_size, &mychk->key); | 329 | GNUNET_CRYPTO_hash (pt_block, pt_size, &mychk->key); |
321 | GNUNET_CRYPTO_hash_to_aes_key (&mychk->key, &sk, &iv); | 330 | 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) | |||
324 | &sk, | 333 | &sk, |
325 | &iv, | 334 | &iv, |
326 | enc); | 335 | enc); |
336 | GNUNET_CRYPTO_hash (enc, pt_size, &mychk->query); | ||
337 | #if DEBUG_TREE | ||
338 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
339 | "TE calculates query to be `%s'\n", | ||
340 | GNUNET_h2s (&mychk->query)); | ||
341 | #endif | ||
327 | if (NULL != te->proc) | 342 | if (NULL != te->proc) |
328 | te->proc (te->cls, | 343 | te->proc (te->cls, |
329 | &mychk->query, | 344 | &mychk->query, |
330 | te->publish_offset, | 345 | te->publish_offset, |
331 | pt_size, | ||
332 | enc, | ||
333 | (te->current_depth == te->chk_tree_depth) | 346 | (te->current_depth == te->chk_tree_depth) |
334 | ? GNUNET_DATASTORE_BLOCKTYPE_DBLOCK | 347 | ? GNUNET_DATASTORE_BLOCKTYPE_DBLOCK |
335 | : GNUNET_DATASTORE_BLOCKTYPE_IBLOCK); | 348 | : GNUNET_DATASTORE_BLOCKTYPE_IBLOCK, |
349 | enc, | ||
350 | pt_size); | ||
336 | if (NULL != te->progress) | 351 | if (NULL != te->progress) |
337 | te->progress (te->cls, | 352 | te->progress (te->cls, |
338 | te->publish_offset, | 353 | te->publish_offset, |
339 | pt_block, | 354 | pt_block, |
340 | pt_size, | 355 | pt_size, |
341 | te->current_depth); | 356 | te->current_depth); |
342 | GNUNET_CRYPTO_hash (enc, pt_size, &mychk->query); | ||
343 | if (te->current_depth == te->chk_tree_depth) | 357 | if (te->current_depth == te->chk_tree_depth) |
344 | { | 358 | { |
345 | te->publish_offset += pt_size; | 359 | te->publish_offset += pt_size; |