gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r9204 - gnunet/src/fs


From: gnunet
Subject: [GNUnet-SVN] r9204 - gnunet/src/fs
Date: Mon, 19 Oct 2009 08:07:56 -0600

Author: grothoff
Date: 2009-10-19 08:07:56 -0600 (Mon, 19 Oct 2009)
New Revision: 9204

Modified:
   gnunet/src/fs/fs_publish.c
   gnunet/src/fs/fs_tree.c
Log:
fix (bad argument order), plus some more debug statements for now

Modified: gnunet/src/fs/fs_publish.c
===================================================================
--- gnunet/src/fs/fs_publish.c  2009-10-19 13:31:03 UTC (rev 9203)
+++ gnunet/src/fs/fs_publish.c  2009-10-19 14:07:56 UTC (rev 9204)
@@ -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 @@
 
 #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)

Modified: gnunet/src/fs/fs_tree.c
===================================================================
--- gnunet/src/fs/fs_tree.c     2009-10-19 13:31:03 UTC (rev 9203)
+++ gnunet/src/fs/fs_tree.c     2009-10-19 14:07:56 UTC (rev 9204)
@@ -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 @@
     }
   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 @@
                             &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;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]