From 72104f2e83fa724f9667c876dca17a2c5ee9b2a2 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 15 Dec 2015 17:45:44 +0100 Subject: [SERVER] Remove non-working images from list, plus refactoring Now that we can automatically load unknown images from disk on request, it makes sense to remove non-working images from the image list. On future requests, we will look for them on disk again, which is nice in case of temporary storage hickups. Also, some more ore less related locking has been refined (loading images, replicating images) --- src/server/globals.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/server/globals.h') diff --git a/src/server/globals.h b/src/server/globals.h index 575f3ab..0bf34de 100644 --- a/src/server/globals.h +++ b/src/server/globals.h @@ -111,6 +111,7 @@ struct _dnbd3_image int users; // clients currently using this image int id; // Unique ID of this image. Only unique in the context of this running instance of DNBD3-Server time_t atime; // last access time + time_t lastWorkCheck; // last time a non-working image has been checked bool working; // true if image exists and completeness is == 100% or a working upstream proxy is connected pthread_spinlock_t lock; }; @@ -169,6 +170,11 @@ extern bool _isProxy; */ extern bool _proxyPrivateOnly; +/** + * Whether to remove missing images from image list on SIGHUP + */ +extern bool _removeMissingImages; + /** * Read timeout when waiting for or sending data on an uplink */ -- cgit v1.2.3-55-g7522