diff options
Diffstat (limited to 'bin/bbackupd/BackupDaemon.cpp')
-rw-r--r-- | bin/bbackupd/BackupDaemon.cpp | 218 |
1 files changed, 1 insertions, 217 deletions
diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp index 507ac377..0c2f6b97 100644 --- a/bin/bbackupd/BackupDaemon.cpp +++ b/bin/bbackupd/BackupDaemon.cpp @@ -1014,7 +1014,7 @@ void BackupDaemon::RunSyncNow() (*i)->mpDirectoryRecord->SyncDirectory(params, BackupProtocolListDirectory::RootDirectory, - locationPath, std::string("/") + (*i)->mName); + locationPath, std::string("/") + (*i)->mName, **i); // Unset exclude lists (just in case) clientContext.SetExcludeLists(0, 0); @@ -2947,222 +2947,6 @@ typedef struct // -------------------------------------------------------------------------- // // Function -// Name: BackupDaemon::Location::Location() -// Purpose: Constructor -// Created: 11/11/03 -// -// -------------------------------------------------------------------------- -BackupDaemon::Location::Location() - : mIDMapIndex(0), - mpExcludeFiles(0), - mpExcludeDirs(0) -{ -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: BackupDaemon::Location::~Location() -// Purpose: Destructor -// Created: 11/11/03 -// -// -------------------------------------------------------------------------- -BackupDaemon::Location::~Location() -{ - // Clean up exclude locations - if(mpExcludeDirs != 0) - { - delete mpExcludeDirs; - mpExcludeDirs = 0; - } - if(mpExcludeFiles != 0) - { - delete mpExcludeFiles; - mpExcludeFiles = 0; - } -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: BackupDaemon::Location::Deserialize(Archive & rArchive) -// Purpose: Deserializes this object instance from a stream of bytes, using an Archive abstraction. -// -// Created: 2005/04/11 -// -// -------------------------------------------------------------------------- -void BackupDaemon::Location::Deserialize(Archive &rArchive) -{ - // - // - // - mpDirectoryRecord.reset(NULL); - if(mpExcludeFiles) - { - delete mpExcludeFiles; - mpExcludeFiles = NULL; - } - if(mpExcludeDirs) - { - delete mpExcludeDirs; - mpExcludeDirs = NULL; - } - - // - // - // - rArchive.Read(mName); - rArchive.Read(mPath); - rArchive.Read(mIDMapIndex); - - // - // - // - int64_t aMagicMarker = 0; - rArchive.Read(aMagicMarker); - - if(aMagicMarker == ARCHIVE_MAGIC_VALUE_NOOP) - { - // NOOP - } - else if(aMagicMarker == ARCHIVE_MAGIC_VALUE_RECURSE) - { - BackupClientDirectoryRecord *pSubRecord = new BackupClientDirectoryRecord(0, ""); - if(!pSubRecord) - { - throw std::bad_alloc(); - } - - mpDirectoryRecord.reset(pSubRecord); - mpDirectoryRecord->Deserialize(rArchive); - } - else - { - // there is something going on here - THROW_EXCEPTION(ClientException, CorruptStoreObjectInfoFile); - } - - // - // - // - rArchive.Read(aMagicMarker); - - if(aMagicMarker == ARCHIVE_MAGIC_VALUE_NOOP) - { - // NOOP - } - else if(aMagicMarker == ARCHIVE_MAGIC_VALUE_RECURSE) - { - mpExcludeFiles = new ExcludeList; - if(!mpExcludeFiles) - { - throw std::bad_alloc(); - } - - mpExcludeFiles->Deserialize(rArchive); - } - else - { - // there is something going on here - THROW_EXCEPTION(ClientException, CorruptStoreObjectInfoFile); - } - - // - // - // - rArchive.Read(aMagicMarker); - - if(aMagicMarker == ARCHIVE_MAGIC_VALUE_NOOP) - { - // NOOP - } - else if(aMagicMarker == ARCHIVE_MAGIC_VALUE_RECURSE) - { - mpExcludeDirs = new ExcludeList; - if(!mpExcludeDirs) - { - throw std::bad_alloc(); - } - - mpExcludeDirs->Deserialize(rArchive); - } - else - { - // there is something going on here - THROW_EXCEPTION(ClientException, CorruptStoreObjectInfoFile); - } -} - -// -------------------------------------------------------------------------- -// -// Function -// Name: BackupDaemon::Location::Serialize(Archive & rArchive) -// Purpose: Serializes this object instance into a stream of bytes, using an Archive abstraction. -// -// Created: 2005/04/11 -// -// -------------------------------------------------------------------------- -void BackupDaemon::Location::Serialize(Archive & rArchive) const -{ - // - // - // - rArchive.Write(mName); - rArchive.Write(mPath); - rArchive.Write(mIDMapIndex); - - // - // - // - if(mpDirectoryRecord.get() == NULL) - { - int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_NOOP; - rArchive.Write(aMagicMarker); - } - else - { - int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_RECURSE; // be explicit about whether recursion follows - rArchive.Write(aMagicMarker); - - mpDirectoryRecord->Serialize(rArchive); - } - - // - // - // - if(!mpExcludeFiles) - { - int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_NOOP; - rArchive.Write(aMagicMarker); - } - else - { - int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_RECURSE; // be explicit about whether recursion follows - rArchive.Write(aMagicMarker); - - mpExcludeFiles->Serialize(rArchive); - } - - // - // - // - if(!mpExcludeDirs) - { - int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_NOOP; - rArchive.Write(aMagicMarker); - } - else - { - int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_RECURSE; // be explicit about whether recursion follows - rArchive.Write(aMagicMarker); - - mpExcludeDirs->Serialize(rArchive); - } -} - -// -------------------------------------------------------------------------- -// -// Function // Name: BackupDaemon::CommandSocketInfo::CommandSocketInfo() // Purpose: Constructor // Created: 18/2/04 |