[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r8950 - gnunet/src/fs
From: |
gnunet |
Subject: |
[GNUnet-SVN] r8950 - gnunet/src/fs |
Date: |
Sat, 5 Sep 2009 15:01:12 -0600 |
Author: grothoff
Date: 2009-09-05 15:01:12 -0600 (Sat, 05 Sep 2009)
New Revision: 8950
Modified:
gnunet/src/fs/fs_download.c
gnunet/src/fs/fs_tree.c
gnunet/src/fs/fs_tree.h
Log:
towards having download
Modified: gnunet/src/fs/fs_download.c
===================================================================
--- gnunet/src/fs/fs_download.c 2009-09-05 20:57:31 UTC (rev 8949)
+++ gnunet/src/fs/fs_download.c 2009-09-05 21:01:12 UTC (rev 8950)
@@ -33,6 +33,7 @@
#include "gnunet_constants.h"
#include "gnunet_fs_service.h"
#include "fs.h"
+#include "fs_tree.h"
#define DEBUG_DOWNLOAD GNUNET_YES
@@ -388,7 +389,7 @@
dc->anonymity = anonymity;
dc->options = options;
dc->active = GNUNET_CONTAINER_multihashmap_create (1 + (length /
DBLOCK_SIZE));
- // FIXME: calculate tree depth
+ dc->treedepth = GNUNET_FS_compute_depth
(GNUNET_ntohll(dc->uri->data.chk.file_length));
// FIXME: make persistent
schedule_block_download (dc,
&dc->uri->data.chk.chk,
Modified: gnunet/src/fs/fs_tree.c
===================================================================
--- gnunet/src/fs/fs_tree.c 2009-09-05 20:57:31 UTC (rev 8949)
+++ gnunet/src/fs/fs_tree.c 2009-09-05 21:01:12 UTC (rev 8950)
@@ -121,8 +121,8 @@
* @param flen file length for which to compute the depth
* @return depth of the tree
*/
-static unsigned int
-compute_depth (uint64_t flen)
+unsigned int
+GNUNET_FS_compute_depth (uint64_t flen)
{
unsigned int treeDepth;
uint64_t fl;
@@ -179,7 +179,7 @@
te->proc = proc;
te->progress = progress;
te->cont = cont;
- te->chk_tree_depth = compute_depth (size);
+ te->chk_tree_depth = GNUNET_FS_compute_depth (size);
te->current_depth = te->chk_tree_depth;
te->chk_tree = GNUNET_malloc (te->chk_tree_depth *
CHK_PER_INODE *
Modified: gnunet/src/fs/fs_tree.h
===================================================================
--- gnunet/src/fs/fs_tree.h 2009-09-05 20:57:31 UTC (rev 8949)
+++ gnunet/src/fs/fs_tree.h 2009-09-05 21:01:12 UTC (rev 8950)
@@ -35,6 +35,16 @@
#include "fs.h"
/**
+ * Compute the depth of the CHK tree.
+ *
+ * @param flen file length for which to compute the depth
+ * @return depth of the tree
+ */
+unsigned int
+GNUNET_FS_compute_depth (uint64_t flen);
+
+
+/**
* Context for an ECRS-based file encoder that computes
* the Merkle-ish-CHK tree.
*/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r8950 - gnunet/src/fs,
gnunet <=