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

     
    23652365 
    23662366static const int STOREOBJECTINFO_MAGIC_ID_VALUE = 0x7777525F; 
    23672367static const std::string STOREOBJECTINFO_MAGIC_ID_STRING = "BBACKUPD-STATE"; 
    2368 static const int STOREOBJECTINFO_VERSION = 1; 
     2368static const int STOREOBJECTINFO_VERSION = 2; 
    23692369 
    23702370bool BackupDaemon::SerializeStoreObjectInfo(int64_t aClientStoreMarker, box_time_t theLastSyncTime, box_time_t theNextSyncTime) const 
    23712371{ 
     
    24242424                // 
    24252425                // 
    24262426                // 
     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                // 
    24272442                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); 
    24302445        } 
    24312446        catch(std::exception &e) 
    24322447        { 
     
    25852600                // 
    25862601                // 
    25872602                // 
     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                // 
    25882623                aFile.Close(); 
    25892624                ::syslog(LOG_INFO, "Loaded store object info file '%s', " 
    25902625                        "version [%d]", StoreObjectInfoFile.c_str(),