Ignore:
Timestamp:
28/05/2008 16:24:05 (4 years ago)
Author:
chris
Message:

Track and log file deletions by name.

Split crypto init and file sync process into its own method, to reduce
call depth and facilitate calling in process from tests.

Differentiate between 3 uses of stat in BackupClientDirectoryRecord? by
renaming the structures.

Use stat instead of lstat when checking the filesystem that's holding an
entity, in case it's a symbolic link to a different filesystem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/bin/bbackupd/BackupDaemon.h

    r2099 r2181  
    1515#include <memory> 
    1616 
     17#include "BackupClientDirectoryRecord.h" 
    1718#include "BoxTime.h" 
    1819#include "Daemon.h" 
    19 #include "BackupClientDirectoryRecord.h" 
     20#include "Logging.h" 
    2021#include "Socket.h" 
    2122#include "SocketListen.h" 
    2223#include "SocketStream.h" 
    23 #include "Logging.h" 
     24#include "TLSContext.h" 
     25 
    2426#include "autogen_BackupProtocolClient.h" 
    2527 
     
    5355        // methods below do partial (specialized) serialization of  
    5456        // client state only 
    55         bool SerializeStoreObjectInfo(int64_t aClientStoreMarker,  
    56                 box_time_t theLastSyncTime, box_time_t theNextSyncTime) const; 
    57         bool DeserializeStoreObjectInfo(int64_t & aClientStoreMarker,  
    58                 box_time_t & theLastSyncTime, box_time_t & theNextSyncTime); 
     57        bool SerializeStoreObjectInfo(box_time_t theLastSyncTime, 
     58                box_time_t theNextSyncTime) const; 
     59        bool DeserializeStoreObjectInfo(box_time_t & theLastSyncTime, 
     60                box_time_t & theNextSyncTime); 
    5961        bool DeleteStoreObjectInfo() const; 
    6062        BackupDaemon(const BackupDaemon &); 
     
    112114        void Run2(); 
    113115 
     116public: 
     117        void InitCrypto(); 
     118        void RunSyncNow(); 
     119 
     120private: 
    114121        void DeleteAllLocations(); 
    115122        void SetupLocations(BackupClientContext &rClientContext, const Configuration &rLocationsConf); 
     
    206213        std::vector<std::pair<int64_t,std::string> > mUnusedRootDirEntries; 
    207214 
     215        int64_t mClientStoreMarker; 
     216        bool mStorageLimitExceeded; 
     217        bool mReadErrorsOnFilesystemObjects; 
     218        box_time_t mLastSyncTime; 
     219        TLSContext mTlsContext; 
     220 
    208221public: 
    209222        bool StopRun() { return this->Daemon::StopRun(); } 
     223        bool StorageLimitExceeded() { return mStorageLimitExceeded; } 
    210224  
    211225private: 
     
    428442                }  
    429443        } 
     444        virtual void NotifyDirectoryDeleted( 
     445                int64_t ObjectID, 
     446                const std::string& rRemotePath) 
     447        { 
     448                if (mLogAllFileAccess) 
     449                { 
     450                        BOX_NOTICE("Deleted directory: " << rRemotePath <<  
     451                                " (ID " << BOX_FORMAT_OBJECTID(ObjectID) << 
     452                                ")"); 
     453                } 
     454        } 
     455        virtual void NotifyFileDeleted( 
     456                int64_t ObjectID, 
     457                const std::string& rRemotePath) 
     458        { 
     459                if (mLogAllFileAccess) 
     460                { 
     461                        BOX_NOTICE("Deleted file: " << rRemotePath <<  
     462                                " (ID " << BOX_FORMAT_OBJECTID(ObjectID) << 
     463                                ")"); 
     464                } 
     465        } 
    430466 
    431467#ifdef WIN32 
Note: See TracChangeset for help on using the changeset viewer.