summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-08-08 09:20:41 +0000
committerChristian Grothoff <christian@grothoff.org>2010-08-08 09:20:41 +0000
commit53ad591c48993023756180abc724622b17331acc (patch)
tree901335a297692ce083f327dbb236e73581c2e6e0
parentfc7c9cc1cb89c536961b330e1180de69f6eb3358 (diff)
misc fixes
-rw-r--r--TODO4
-rw-r--r--src/datastore/datastore.h2
-rw-r--r--src/datastore/datastore_api.c4
-rw-r--r--src/fs/fs_unindex.c13
-rw-r--r--src/fs/test_fs_unindex_persistence.c16
5 files changed, 28 insertions, 11 deletions
diff --git a/TODO b/TODO
index 905d6a060..369528688 100644
--- a/TODO
+++ b/TODO
@@ -20,12 +20,10 @@
* 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
diff --git a/src/datastore/datastore.h b/src/datastore/datastore.h
index aa2646c0a..f827f8766 100644
--- a/src/datastore/datastore.h
+++ b/src/datastore/datastore.h
@@ -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"
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c
index aaad7118f..21675b0b7 100644
--- a/src/datastore/datastore_api.c
+++ b/src/datastore/datastore_api.c
@@ -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;
diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c
index 38e1073f0..375b833fb 100644
--- a/src/fs/fs_unindex.c
+++ b/src/fs/fs_unindex.c
@@ -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;
diff --git a/src/fs/test_fs_unindex_persistence.c b/src/fs/test_fs_unindex_persistence.c
index 43d03fcb6..3483b7e09 100644
--- a/src/fs/test_fs_unindex_persistence.c
+++ b/src/fs/test_fs_unindex_persistence.c
@@ -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;
+ }
}