fs fix
authorChristian Grothoff <christian@grothoff.org>
Fri, 16 Apr 2010 11:58:00 +0000 (11:58 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 16 Apr 2010 11:58:00 +0000 (11:58 +0000)
contrib/defaults.conf
src/fs/fs_download.c
src/fs/fs_publish.c
src/fs/fs_tree.c

index 3c7f57bf2eb21f97e5a0406ff6002b677c0d163d..080c87e1d3e26f175ebb88cbd28eeb4d7e97034d 100644 (file)
@@ -163,6 +163,7 @@ BINARY = gnunet-daemon-topology
 HTTPPORT = 8080
 HOSTNAME = localhost
 HOME = $SERVICEHOME
+HOSTLISTFILE = $SERVICEHOME/hostlist/learned.data
 CONFIG = $DEFAULTCONFIG
 BINARY = gnunet-daemon-hostlist
 # consider having "-e" as default as well once implemented
index 934f3567f855163c7de81d8201d0b6c71c12b0fa..6e215ed27a98025de3769e98f1c5cda7dee6ab96 100644 (file)
@@ -38,7 +38,7 @@
 #include "fs.h"
 #include "fs_tree.h"
 
-#define DEBUG_DOWNLOAD GNUNET_YES
+#define DEBUG_DOWNLOAD GNUNET_NO
 
 /**
  * We're storing the IBLOCKS after the DBLOCKS on disk (so that we
index 79ffd1886759f76c19790fdc8fcf7a9ecf44c010..fac75a848d54d37b500b153126b68410cddc67c6 100644 (file)
@@ -40,7 +40,7 @@
 #include "fs.h"
 #include "fs_tree.h"
 
-#define DEBUG_PUBLISH GNUNET_YES
+#define DEBUG_PUBLISH GNUNET_NO
 
 /**
  * Main function that performs the upload.
@@ -129,6 +129,8 @@ publish_cleanup (struct GNUNET_FS_PublishContext *sc)
   GNUNET_free_non_null (sc->nid);  
   GNUNET_free_non_null (sc->nuid);
   GNUNET_DATASTORE_disconnect (sc->dsh, GNUNET_NO);
+  if (sc->client != NULL)
+    GNUNET_CLIENT_disconnect (sc->client, GNUNET_NO);
   GNUNET_free (sc);
 }
 
index e8b1f469d3841e5a6caece5b56672da424c6560e..1280548d8189565bf0dfebdd3199b412737624cb 100644 (file)
@@ -31,7 +31,7 @@
 #include "platform.h"
 #include "fs_tree.h"
 
-#define DEBUG_TREE GNUNET_YES
+#define DEBUG_TREE GNUNET_NO
 
 /**
  * Context for an ECRS-based file encoder that computes
@@ -251,6 +251,8 @@ compute_chk_offset (unsigned int height,
                                  corresponds to */
   for (i=0;i<height;i++)
     bds *= CHK_PER_INODE;
+  if (height > 0)
+    offset--; /* round down since for height > 0 offset is at the END of the block */
   ret = offset / bds;
   return ret % CHK_PER_INODE; 
 }