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,
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;
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,
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)
{
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));
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,
#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
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,
#endif
break;
case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
-#if DEBUG_VERBOSE
+#if VERBOSE
printf ("Publish complete.\n");
#endif
GNUNET_SCHEDULER_add_continuation (sched,
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,
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,
HOSTNAME = localhost
DEFAULTSERVICES = resolver datastore transport core fs
+[datastore]
+DEBUG = YES
+
[statistics]
PORT = 42467
HOSTNAME = localhost