diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-10-19 13:31:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-10-19 13:31:03 +0000 |
commit | 8da608f0e8391f0159c1e8faf43e8085a9309ce0 (patch) | |
tree | d12ec36ef7f7e6fce12a5c1499069f4c076f5637 /src/fs/fs_download.c | |
parent | 6ee357f1ac32f1ca6c8012a2d17f09901eb2ed50 (diff) | |
download | gnunet-8da608f0e8391f0159c1e8faf43e8085a9309ce0.tar.gz gnunet-8da608f0e8391f0159c1e8faf43e8085a9309ce0.zip |
fixes
Diffstat (limited to 'src/fs/fs_download.c')
-rw-r--r-- | src/fs/fs_download.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index 346857c24..6d3886c70 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c | |||
@@ -176,6 +176,13 @@ schedule_block_download (struct GNUNET_FS_DownloadContext *dc, | |||
176 | struct DownloadRequest *sm; | 176 | struct DownloadRequest *sm; |
177 | uint64_t off; | 177 | uint64_t off; |
178 | 178 | ||
179 | #if DEBUG_DOWNLOAD | ||
180 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
181 | "Scheduling download at offset %llu and depth %u for `%s'\n", | ||
182 | (unsigned long long) offset, | ||
183 | depth, | ||
184 | GNUNET_h2s (&chk->query)); | ||
185 | #endif | ||
179 | off = compute_disk_offset (GNUNET_ntohll (dc->uri->data.chk.file_length), | 186 | off = compute_disk_offset (GNUNET_ntohll (dc->uri->data.chk.file_length), |
180 | offset, | 187 | offset, |
181 | depth, | 188 | depth, |
@@ -676,6 +683,12 @@ GNUNET_FS_download_start (struct GNUNET_FS_Handle *h, | |||
676 | GNUNET_break (0); | 683 | GNUNET_break (0); |
677 | return NULL; | 684 | return NULL; |
678 | } | 685 | } |
686 | #if DEBUG_DOWNLOAD | ||
687 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
688 | "Starting download `%s' of %llu bytes\n", | ||
689 | filename, | ||
690 | (unsigned long long) length); | ||
691 | #endif | ||
679 | dc = GNUNET_malloc (sizeof(struct GNUNET_FS_DownloadContext)); | 692 | dc = GNUNET_malloc (sizeof(struct GNUNET_FS_DownloadContext)); |
680 | dc->h = h; | 693 | dc->h = h; |
681 | dc->client = client; | 694 | dc->client = client; |
@@ -717,6 +730,11 @@ GNUNET_FS_download_start (struct GNUNET_FS_Handle *h, | |||
717 | dc->options = options; | 730 | dc->options = options; |
718 | dc->active = GNUNET_CONTAINER_multihashmap_create (1 + (length / DBLOCK_SIZE)); | 731 | dc->active = GNUNET_CONTAINER_multihashmap_create (1 + (length / DBLOCK_SIZE)); |
719 | dc->treedepth = GNUNET_FS_compute_depth (GNUNET_ntohll(dc->uri->data.chk.file_length)); | 732 | dc->treedepth = GNUNET_FS_compute_depth (GNUNET_ntohll(dc->uri->data.chk.file_length)); |
733 | #if DEBUG_DOWNLOAD | ||
734 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
735 | "Download tree has depth %u\n", | ||
736 | dc->treedepth); | ||
737 | #endif | ||
720 | // FIXME: make persistent | 738 | // FIXME: make persistent |
721 | schedule_block_download (dc, | 739 | schedule_block_download (dc, |
722 | &dc->uri->data.chk.chk, | 740 | &dc->uri->data.chk.chk, |