summaryrefslogtreecommitdiff
path: root/bin/bbackupd
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2007-07-26 21:54:04 +0000
committerChris Wilson <chris+github@qwirx.com>2007-07-26 21:54:04 +0000
commit211d24938fdfadae7e8c9b152bdf936dc4b82249 (patch)
tree0101976f2eab63f59f5514399a5bdd11305723cc /bin/bbackupd
parentb39d9117ec9fbbf83b63bbd2eb5b4cb34feb123a (diff)
Apply Gary's patch to save the list of unused root directory entries
in the store object info file, so that they will persist across restarts. (refs #18, refs #3, merges [1658])
Diffstat (limited to 'bin/bbackupd')
-rw-r--r--bin/bbackupd/BackupDaemon.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp
index 4e5621a4..edb1246a 100644
--- a/bin/bbackupd/BackupDaemon.cpp
+++ b/bin/bbackupd/BackupDaemon.cpp
@@ -2611,7 +2611,7 @@ BackupDaemon::CommandSocketInfo::~CommandSocketInfo()
static const int STOREOBJECTINFO_MAGIC_ID_VALUE = 0x7777525F;
static const std::string STOREOBJECTINFO_MAGIC_ID_STRING = "BBACKUPD-STATE";
-static const int STOREOBJECTINFO_VERSION = 1;
+static const int STOREOBJECTINFO_VERSION = 2;
bool BackupDaemon::SerializeStoreObjectInfo(int64_t aClientStoreMarker, box_time_t theLastSyncTime, box_time_t theNextSyncTime) const
{
@@ -2671,8 +2671,9 @@ bool BackupDaemon::SerializeStoreObjectInfo(int64_t aClientStoreMarker, box_time
//
//
aFile.Close();
- BOX_INFO("Saved store object info file: "
- << StoreObjectInfoFile);
+ BOX_INFO("Saved store object info file: " <<
+ StoreObjectInfoFile << ", version " <<
+ STOREOBJECTINFO_VERSION);
}
catch(std::exception &e)
{
@@ -2830,6 +2831,26 @@ bool BackupDaemon::DeserializeStoreObjectInfo(int64_t & aClientStoreMarker, box_
//
//
//
+ iCount = 0;
+ anArchive.Read(iCount);
+
+ for(int v = 0; v < iCount; v++)
+ {
+ int64_t anId;
+ anArchive.Read(anId);
+
+ std::string aName;
+ anArchive.Read(aName);
+
+ mUnusedRootDirEntries.push_back(std::pair<int64_t, std::string>(anId, aName));
+ }
+
+ if (iCount > 0)
+ anArchive.Read(mDeleteUnusedRootDirEntriesAfter);
+
+ //
+ //
+ //
aFile.Close();
BOX_INFO("Loaded store object info file version " << iVersion
<< "(" << StoreObjectInfoFile << ")");