[Box Backup-commit] COMMIT r1658 - box/chris/general/bin/bbackupd
boxbackup-dev@fluffy.co.uk
boxbackup-dev@fluffy.co.uk
Tue, 15 May 2007 21:56:32 +0100
Author: chris
Date: 2007-05-15 21:56:32 +0100 (Tue, 15 May 2007)
New Revision: 1658
Modified:
box/chris/general/bin/bbackupd/BackupDaemon.cpp
Log:
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)
Modified: box/chris/general/bin/bbackupd/BackupDaemon.cpp
===================================================================
--- box/chris/general/bin/bbackupd/BackupDaemon.cpp 2007-05-13 22:56:33 UTC (rev 1657)
+++ box/chris/general/bin/bbackupd/BackupDaemon.cpp 2007-05-15 20:56:32 UTC (rev 1658)
@@ -2558,7 +2558,7 @@
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
{
@@ -2618,8 +2618,9 @@
//
//
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)
{
@@ -2777,6 +2778,26 @@
//
//
//
+ 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 << ")");