fix ttl underflow check
authorChristian Grothoff <christian@grothoff.org>
Thu, 15 Apr 2010 14:40:14 +0000 (14:40 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 15 Apr 2010 14:40:14 +0000 (14:40 +0000)
src/fs/fs_download.c
src/fs/fs_publish.c
src/fs/fs_tree.c
src/fs/gnunet-service-fs.c

index b8e4de813ea84f4b27d3c55d70851d90e0d0c222..934f3567f855163c7de81d8201d0b6c71c12b0fa 100644 (file)
@@ -38,7 +38,7 @@
 #include "fs.h"
 #include "fs_tree.h"
 
-#define DEBUG_DOWNLOAD GNUNET_NO
+#define DEBUG_DOWNLOAD GNUNET_YES
 
 /**
  * We're storing the IBLOCKS after the DBLOCKS on disk (so that we
@@ -175,8 +175,7 @@ transmit_download_request (void *cls,
 
 
 /**
- * Schedule the download of the specified
- * block in the tree.
+ * Schedule the download of the specified block in the tree.
  *
  * @param dc overall download this block belongs to
  * @param chk content-hash-key of the block
index 0931b682986f91bec4e77c619d0c21667b7f8dec..79ffd1886759f76c19790fdc8fcf7a9ecf44c010 100644 (file)
@@ -40,7 +40,7 @@
 #include "fs.h"
 #include "fs_tree.h"
 
-#define DEBUG_PUBLISH GNUNET_NO
+#define DEBUG_PUBLISH GNUNET_YES
 
 /**
  * Main function that performs the upload.
@@ -1080,8 +1080,6 @@ GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *sc)
 {
   if (GNUNET_SCHEDULER_NO_TASK != sc->upload_task)
     GNUNET_SCHEDULER_cancel (sc->h->sched, sc->upload_task);
-  else
-    GNUNET_assert (sc->all_done == GNUNET_YES);
   // FIXME: remove from persistence DB (?) --- think more about
   //        shutdown / persistent-resume APIs!!!
   GNUNET_FS_file_information_inspect (sc->fi,
index 07f78eea7748245bce94e710e12f11e02ff1d16b..e8b1f469d3841e5a6caece5b56672da424c6560e 100644 (file)
@@ -31,7 +31,7 @@
 #include "platform.h"
 #include "fs_tree.h"
 
-#define DEBUG_TREE GNUNET_NO
+#define DEBUG_TREE GNUNET_YES
 
 /**
  * Context for an ECRS-based file encoder that computes
@@ -257,9 +257,8 @@ compute_chk_offset (unsigned int height,
 
 
 /**
- * Encrypt the next block of the file (and 
- * call proc and progress accordingly; or 
- * of course "cont" if we have already completed
+ * Encrypt the next block of the file (and call proc and progress
+ * accordingly; or of course "cont" if we have already completed
  * encoding of the entire file).
  *
  * @param te tree encoder to use
index e0cd7d0dd3903e7fe7a14ccf46a580eefa401404..a18e3447ff6f4948d65c2cb11ba2f24499ce077f 100644 (file)
@@ -48,7 +48,7 @@
 #include "gnunet-service-fs_indexing.h"
 #include "fs.h"
 
-#define DEBUG_FS GNUNET_NO
+#define DEBUG_FS GNUNET_YES
 
 /**
  * Maximum number of outgoing messages we queue per peer.
@@ -2689,7 +2689,7 @@ handle_p2p_get (void *cls,
     GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
                              TTL_DECREMENT);
   if ( (pr->ttl < 0) &&
-       (pr->ttl - ttl_decrement > 0) )
+       (((int32_t)(pr->ttl - ttl_decrement)) > 0) )
     {
 #if DEBUG_FS
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -2967,7 +2967,7 @@ handle_start_search (void *cls,
                                &pr->mingle,
                                &pr->bf_size,
                                pr->replies_seen);
- pr->query = sm->query;
 pr->query = sm->query;
   switch (type)
     {
     case GNUNET_DATASTORE_BLOCKTYPE_DBLOCK: