From 53ad591c48993023756180abc724622b17331acc Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 8 Aug 2010 09:20:41 +0000 Subject: misc fixes --- src/datastore/datastore.h | 2 +- src/datastore/datastore_api.c | 4 ++-- src/fs/fs_unindex.c | 13 +++++++++++++ src/fs/test_fs_unindex_persistence.c | 16 +++++++++++----- 4 files changed, 27 insertions(+), 8 deletions(-) (limited to 'src') 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; + } } -- cgit v1.2.3