Ticket #18: bbackupd-obj-store-v2.patch
| File bbackupd-obj-store-v2.patch, 1.7 KB (added by gniemcew, 5 years ago) |
|---|
-
bin/bbackupd/BackupDaemon.cpp
2365 2365 2366 2366 static const int STOREOBJECTINFO_MAGIC_ID_VALUE = 0x7777525F; 2367 2367 static const std::string STOREOBJECTINFO_MAGIC_ID_STRING = "BBACKUPD-STATE"; 2368 static const int STOREOBJECTINFO_VERSION = 1;2368 static const int STOREOBJECTINFO_VERSION = 2; 2369 2369 2370 2370 bool BackupDaemon::SerializeStoreObjectInfo(int64_t aClientStoreMarker, box_time_t theLastSyncTime, box_time_t theNextSyncTime) const 2371 2371 { … … 2424 2424 // 2425 2425 // 2426 2426 // 2427 iCount = mUnusedRootDirEntries.size(); 2428 anArchive.Write(iCount); 2429 2430 for(int v = 0; v < iCount; v++) 2431 { 2432 anArchive.Write(mUnusedRootDirEntries[v].first); 2433 anArchive.Write(mUnusedRootDirEntries[v].second); 2434 } 2435 2436 if (iCount > 0) 2437 anArchive.Write(mDeleteUnusedRootDirEntriesAfter); 2438 2439 // 2440 // 2441 // 2427 2442 aFile.Close(); 2428 ::syslog(LOG_INFO, "Saved store object info file '%s' ",2429 StoreObjectInfoFile.c_str() );2443 ::syslog(LOG_INFO, "Saved store object info file '%s', version [%d]", 2444 StoreObjectInfoFile.c_str(), STOREOBJECTINFO_VERSION); 2430 2445 } 2431 2446 catch(std::exception &e) 2432 2447 { … … 2585 2600 // 2586 2601 // 2587 2602 // 2603 iCount = 0; 2604 anArchive.Read(iCount); 2605 2606 for(int v = 0; v < iCount; v++) 2607 { 2608 int64_t anId; 2609 anArchive.Read(anId); 2610 2611 std::string aName; 2612 anArchive.Read(aName); 2613 2614 mUnusedRootDirEntries.push_back(std::pair<int64_t, std::string>(anId, aName)); 2615 } 2616 2617 if (iCount > 0) 2618 anArchive.Read(mDeleteUnusedRootDirEntriesAfter); 2619 2620 // 2621 // 2622 // 2588 2623 aFile.Close(); 2589 2624 ::syslog(LOG_INFO, "Loaded store object info file '%s', " 2590 2625 "version [%d]", StoreObjectInfoFile.c_str(),
