From 2fbce9fa99ecd721ad54f8f1a1fe25a6d782df1f Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 3 Nov 2011 13:24:10 +0000 Subject: [PATCH] fix 1866 -- stats instead of warning --- src/fs/gnunet-service-fs_indexing.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/fs/gnunet-service-fs_indexing.c b/src/fs/gnunet-service-fs_indexing.c index ab3f77abe..ce3f21cd6 100644 --- a/src/fs/gnunet-service-fs_indexing.c +++ b/src/fs/gnunet-service-fs_indexing.c @@ -538,6 +538,16 @@ GNUNET_FS_handle_on_demand_block (const GNUNET_HashCode * key, uint32_t size, odb = (const struct OnDemandBlock *) data; off = GNUNET_ntohll (odb->offset); fn = (const char *) GNUNET_CONTAINER_multihashmap_get (ifm, &odb->file_id); + if (0 != ACCESS (fn, R_OK)) + { + GNUNET_STATISTICS_update (GSF_stats, + gettext_noop ("# index blocks removed: original file inaccessible"), + 1, + GNUNET_YES); + GNUNET_DATASTORE_remove (dsh, key, size, data, -1, -1, + GNUNET_TIME_UNIT_FOREVER_REL, &remove_cont, NULL); + return GNUNET_SYSERR; + } fh = NULL; if ((NULL == fn) || (NULL == -- 2.25.1