misc fixes
authorChristian Grothoff <christian@grothoff.org>
Sun, 8 Aug 2010 09:20:41 +0000 (09:20 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 8 Aug 2010 09:20:41 +0000 (09:20 +0000)
TODO
src/datastore/datastore.h
src/datastore/datastore_api.c
src/fs/fs_unindex.c
src/fs/test_fs_unindex_persistence.c

diff --git a/TODO b/TODO
index 905d6a06001582b9f433b6bad48216796dd71499..3695286883ef0b7b34f8b14e3ae2ce2efea2694e 100644 (file)
--- a/TODO
+++ b/TODO
 * GNUNET-GTK: [CG]
   - bugs:
     + handle 'lost parent' case for recursive downloads (need to move children!)
-    + clean up TreeStores in main_window_file_publish on dialog close
-    + clean up ListStores in main_window_adv_pseudonym 
 
 0.9.0pre3:
 * Determine RC bugs and fix those!
-* DATASTORE: [NN]
+* DATASTORE: [LT]
   - GNUNET_DATASTORE_cancel method not tested [LT]
 * TESTING: [Nate]
   - test basic peer re-configure 
index aa2646c0a7b04ad166be11dea91eda16552d3800..f827f87664f1634d9042f32fd3106c7fffd5d4d8 100644 (file)
@@ -27,7 +27,7 @@
 #ifndef DATASTORE_H
 #define DATASTORE_H
 
-#define DEBUG_DATASTORE GNUNET_NO
+#define DEBUG_DATASTORE GNUNET_YES
 
 #include "gnunet_util_lib.h"
 
index aaad7118fca5a00a6ec781b4d800a370e5a7e5e2..21675b0b7c0fecb1b54858cf676ff1e793f3e9bb 100644 (file)
@@ -682,11 +682,11 @@ process_status_message (void *cls,
   if (msg == NULL)
     {      
       free_queue_entry (qe);
+      if (NULL == h->client)
+       return; /* forced disconnect */
       rc.cont (rc.cont_cls, 
               GNUNET_SYSERR,
               _("Failed to receive response from database."));
-      if (NULL == h->client)
-       return; /* forced disconnect */
       if (was_transmitted == GNUNET_YES)
        do_disconnect (h);
       return;
index 38e1073f0a3735a263a30f67602396a11b426e1a..375b833fbd28b7a23b169bd1d86dfa1320c2982e 100644 (file)
@@ -31,6 +31,7 @@
 #include "fs.h"
 #include "fs_tree.h"
 
+#define DEBUG_UNINDEX GNUNET_NO
 
 /**
  * Function called by the tree encoder to obtain
@@ -172,6 +173,10 @@ process_cont (void *cls,
       signal_unindex_error (uc);
       return;
     }  
+#if DEBUG_UNINDEX
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Datastore REMOVE operation succeeded\n");
+#endif
   GNUNET_FS_tree_encoder_next (uc->tc);
 }
 
@@ -214,6 +219,10 @@ unindex_process (void *cls,
       odb.file_id = uc->file_id;
       data = &odb;
     }
+#if DEBUG_UNINDEX
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Sending REMOVE request to DATASTORE service\n");
+#endif
   GNUNET_DATASTORE_remove (uc->dsh,
                           query,
                           size,
@@ -320,6 +329,10 @@ unindex_finish (void *cls,
       signal_unindex_error (uc);
       return;
     }
+#if DEBUG_UNINDEX
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Sending UNINDEX message to FS service\n");
+#endif
   req.header.size = htons (sizeof (struct UnindexMessage));
   req.header.type = htons (GNUNET_MESSAGE_TYPE_FS_UNINDEX);
   req.reserved = 0;
index 43d03fcb6e7ba80340dda331bf118b5d0c723afa..3483b7e0992337b6309595ab44be20477d66d1b7 100644 (file)
@@ -84,11 +84,17 @@ static void
 abort_unindex_task (void *cls,
                    const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  GNUNET_FS_unindex_stop (unindex);
-  unindex = NULL;
-  GNUNET_DISK_directory_remove (fn);
-  GNUNET_free (fn);
-  fn = NULL;
+  if (unindex != NULL)
+    {
+      GNUNET_FS_unindex_stop (unindex);
+      unindex = NULL;
+    }
+  if (fn != NULL)
+    {
+      GNUNET_DISK_directory_remove (fn);
+      GNUNET_free (fn);
+      fn = NULL;
+    }
 }