aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-10-19 14:07:56 +0000
committerChristian Grothoff <christian@grothoff.org>2009-10-19 14:07:56 +0000
commit11ce3736a27e5f9082411eea577c05c58ad2793b (patch)
tree620ba43b7f67020bcabd5670c4e8f9ef523efc70 /src
parent8da608f0e8391f0159c1e8faf43e8085a9309ce0 (diff)
downloadgnunet-11ce3736a27e5f9082411eea577c05c58ad2793b.tar.gz
gnunet-11ce3736a27e5f9082411eea577c05c58ad2793b.zip
fix (bad argument order), plus some more debug statements for now
Diffstat (limited to 'src')
-rw-r--r--src/fs/fs_publish.c6
-rw-r--r--src/fs/fs_tree.c22
2 files changed, 21 insertions, 7 deletions
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 @@
26 * @author Christian Grothoff 26 * @author Christian Grothoff
27 * 27 *
28 * TODO: 28 * TODO:
29 * - code-sharing with unindex (write unindex code)
30 * - indexing cleanup: unindex on failure (can wait) 29 * - indexing cleanup: unindex on failure (can wait)
31 * - persistence support (can wait) 30 * - persistence support (can wait)
32 * - datastore reservation support (optimization) 31 * - datastore reservation support (optimization)
@@ -485,9 +484,10 @@ block_proc (void *cls,
485 484
486#if DEBUG_PUBLISH 485#if DEBUG_PUBLISH
487 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 486 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
488 "Publishing block `%s' for offset %llu\n", 487 "Publishing block `%s' for offset %llu with size %u\n",
489 GNUNET_h2s (query), 488 GNUNET_h2s (query),
490 (unsigned long long) offset); 489 (unsigned long long) offset,
490 (unsigned int) block_size);
491#endif 491#endif
492 p = sc->fi_pos; 492 p = sc->fi_pos;
493 if (NULL == sc->dsh) 493 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 @@
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;