gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r9203 - gnunet/src/fs
Date: Mon, 19 Oct 2009 07:31:05 -0600

Author: grothoff
Date: 2009-10-19 07:31:03 -0600 (Mon, 19 Oct 2009)
New Revision: 9203

Modified:
   gnunet/src/fs/fs_download.c
   gnunet/src/fs/fs_publish.c
   gnunet/src/fs/fs_tree.c
   gnunet/src/fs/test_fs_download.c
   gnunet/src/fs/test_fs_download_data.conf
Log:
fixes

Modified: gnunet/src/fs/fs_download.c
===================================================================
--- gnunet/src/fs/fs_download.c 2009-10-19 12:29:04 UTC (rev 9202)
+++ gnunet/src/fs/fs_download.c 2009-10-19 13:31:03 UTC (rev 9203)
@@ -176,6 +176,13 @@
   struct DownloadRequest *sm;
   uint64_t off;
 
+#if DEBUG_DOWNLOAD
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Scheduling download at offset %llu and depth %u for `%s'\n",
+             (unsigned long long) offset,
+             depth,
+             GNUNET_h2s (&chk->query));
+#endif
   off = compute_disk_offset (GNUNET_ntohll (dc->uri->data.chk.file_length),
                             offset,
                             depth,
@@ -676,6 +683,12 @@
       GNUNET_break (0);
       return NULL;
     }
+#if DEBUG_DOWNLOAD
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Starting download `%s' of %llu bytes\n",
+             filename,
+             (unsigned long long) length);
+#endif
   dc = GNUNET_malloc (sizeof(struct GNUNET_FS_DownloadContext));
   dc->h = h;
   dc->client = client;
@@ -717,6 +730,11 @@
   dc->options = options;
   dc->active = GNUNET_CONTAINER_multihashmap_create (1 + (length / 
DBLOCK_SIZE));
   dc->treedepth = GNUNET_FS_compute_depth 
(GNUNET_ntohll(dc->uri->data.chk.file_length));
+#if DEBUG_DOWNLOAD
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Download tree has depth %u\n",
+             dc->treedepth);
+#endif
   // FIXME: make persistent
   schedule_block_download (dc, 
                           &dc->uri->data.chk.chk,

Modified: gnunet/src/fs/fs_publish.c
===================================================================
--- gnunet/src/fs/fs_publish.c  2009-10-19 12:29:04 UTC (rev 9202)
+++ gnunet/src/fs/fs_publish.c  2009-10-19 13:31:03 UTC (rev 9203)
@@ -483,6 +483,12 @@
   struct PutContCtx * dpc_cls;
   struct OnDemandBlock odb;
 
+#if DEBUG_PUBLISH
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Publishing block `%s' for offset %llu\n",
+             GNUNET_h2s (query),
+             (unsigned long long) offset);
+#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 12:29:04 UTC (rev 9202)
+++ gnunet/src/fs/fs_tree.c     2009-10-19 13:31:03 UTC (rev 9203)
@@ -301,16 +301,6 @@
       pt_block = &te->chk_tree[te->current_depth *
                               CHK_PER_INODE];
     }
-  off = compute_chk_offset (te->chk_tree_depth - te->current_depth,
-                           te->publish_offset);
-  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);
-  GNUNET_CRYPTO_aes_encrypt (pt_block,
-                            pt_size,
-                            &sk,
-                            &iv,
-                            enc);
   if (0 == te->current_depth)
     {
       te->uri = GNUNET_malloc (sizeof(struct GNUNET_FS_Uri));
@@ -324,6 +314,16 @@
                                         GNUNET_SCHEDULER_REASON_PREREQ_DONE);
       return;
     }
+  off = compute_chk_offset (te->chk_tree_depth - te->current_depth,
+                           te->publish_offset);
+  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);
+  GNUNET_CRYPTO_aes_encrypt (pt_block,
+                            pt_size,
+                            &sk,
+                            &iv,
+                            enc);
   if (NULL != te->proc)
     te->proc (te->cls,
              &mychk->query,

Modified: gnunet/src/fs/test_fs_download.c
===================================================================
--- gnunet/src/fs/test_fs_download.c    2009-10-19 12:29:04 UTC (rev 9202)
+++ gnunet/src/fs/test_fs_download.c    2009-10-19 13:31:03 UTC (rev 9203)
@@ -29,8 +29,7 @@
 #include "gnunet_arm_service.h"
 #include "gnunet_fs_service.h"
 
-#define DEBUG_VERBOSE 42 
-//GNUNET_NO
+#define VERBOSE GNUNET_YES
 
 #define START_ARM GNUNET_YES
 
@@ -95,7 +94,7 @@
   switch (event->status)
     {
     case GNUNET_FS_STATUS_PUBLISH_PROGRESS:
-#if DEBUG_VERBOSE
+#if VERBOSE
       printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n",
               (unsigned long long) event->value.publish.completed,
               (unsigned long long) event->value.publish.size,
@@ -104,7 +103,7 @@
 #endif
       break;
     case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
-#if DEBUG_VERBOSE
+#if VERBOSE
       printf ("Publish complete.\n");
 #endif
       GNUNET_SCHEDULER_add_continuation (sched,
@@ -125,7 +124,7 @@
       GNUNET_assert (download != NULL);
       break;
     case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
-#if DEBUG_VERBOSE
+#if VERBOSE
       printf ("Download complete.\n");
 #endif
       GNUNET_SCHEDULER_add_continuation (sched,
@@ -135,7 +134,7 @@
                                         GNUNET_SCHEDULER_REASON_PREREQ_DONE);
       break;
     case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS:
-#if DEBUG_VERBOSE
+#if VERBOSE
       printf ("Download is progressing (%llu/%llu at level %u off %llu)...\n",
               (unsigned long long) event->value.download.completed,
               (unsigned long long) event->value.download.size,

Modified: gnunet/src/fs/test_fs_download_data.conf
===================================================================
--- gnunet/src/fs/test_fs_download_data.conf    2009-10-19 12:29:04 UTC (rev 
9202)
+++ gnunet/src/fs/test_fs_download_data.conf    2009-10-19 13:31:03 UTC (rev 
9203)
@@ -18,6 +18,9 @@
 HOSTNAME = localhost
 DEFAULTSERVICES = resolver datastore transport core fs
 
+[datastore]
+DEBUG = YES
+
 [statistics]
 PORT = 42467
 HOSTNAME = localhost





reply via email to

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