[Box Backup-dev] COMMIT r321 - in box/gary/boxbackup-0.09-mod: bin/bbackupctl bin/bbackupd bin/bbackupobjdump bin/bbackupquery bin/bbstoreaccounts bin/bbstored infrastructure lib/backupclient lib/backupstore lib/common lib/compress lib/crypto lib/raidfile lib/server test/backupdiff test/backupstore test/backupstorefix test/backupstorepatch test/basicserver test/bbackupd test/common test/compress test/crypto test/raidfile
boxbackup-dev@fluffy.co.uk
boxbackup-dev@fluffy.co.uk
Tue, 17 Jan 2006 22:44:39 +0000 (GMT)
Author: chris
Date: 2006-01-17 22:43:33 +0000 (Tue, 17 Jan 2006)
New Revision: 321
Modified:
box/gary/boxbackup-0.09-mod/bin/bbackupctl/bbackupctl.cpp
box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientContext.cpp
box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientContext.h
box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientDeleteList.cpp
box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientDeleteList.h
box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientDirectoryRecord.cpp
box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientDirectoryRecord.h
box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientInodeToIDMap.cpp
box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientInodeToIDMap.h
box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupDaemon.cpp
box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupDaemon.h
box/gary/boxbackup-0.09-mod/bin/bbackupd/bbackupd.cpp
box/gary/boxbackup-0.09-mod/bin/bbackupobjdump/bbackupobjdump.cpp
box/gary/boxbackup-0.09-mod/bin/bbackupquery/BackupQueries.cpp
box/gary/boxbackup-0.09-mod/bin/bbackupquery/BackupQueries.h
box/gary/boxbackup-0.09-mod/bin/bbackupquery/bbackupquery.cpp
box/gary/boxbackup-0.09-mod/bin/bbstoreaccounts/bbstoreaccounts.cpp
box/gary/boxbackup-0.09-mod/bin/bbstored/BBStoreDHousekeeping.cpp
box/gary/boxbackup-0.09-mod/bin/bbstored/BackupCommands.cpp
box/gary/boxbackup-0.09-mod/bin/bbstored/BackupConstants.h
box/gary/boxbackup-0.09-mod/bin/bbstored/BackupContext.cpp
box/gary/boxbackup-0.09-mod/bin/bbstored/BackupContext.h
box/gary/boxbackup-0.09-mod/bin/bbstored/BackupStoreDaemon.cpp
box/gary/boxbackup-0.09-mod/bin/bbstored/BackupStoreDaemon.h
box/gary/boxbackup-0.09-mod/bin/bbstored/HousekeepStoreAccount.cpp
box/gary/boxbackup-0.09-mod/bin/bbstored/HousekeepStoreAccount.h
box/gary/boxbackup-0.09-mod/bin/bbstored/bbstored.cpp
box/gary/boxbackup-0.09-mod/infrastructure/buildenv-testmain-template.cpp
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupClientCryptoKeys.cpp
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupClientCryptoKeys.h
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupClientFileAttributes.cpp
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupClientFileAttributes.h
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupClientMakeExcludeList.cpp
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupClientMakeExcludeList.h
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupClientRestore.cpp
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupClientRestore.h
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupDaemonConfigVerify.cpp
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupDaemonConfigVerify.h
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreConstants.h
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreDirectory.cpp
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreDirectory.h
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreException.h
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFile.cpp
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFile.h
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileCmbDiff.cpp
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileCmbIdx.cpp
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileCombine.cpp
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileCryptVar.cpp
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileCryptVar.h
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileDiff.cpp
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileEncodeStream.cpp
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileEncodeStream.h
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileRevDiff.cpp
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileWire.h
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFilename.cpp
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFilename.h
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFilenameClear.cpp
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFilenameClear.h
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreObjectDump.cpp
box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreObjectMagic.h
box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreAccountDatabase.cpp
box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreAccountDatabase.h
box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreAccounts.cpp
box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreAccounts.h
box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreCheck.cpp
box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreCheck.h
box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreCheck2.cpp
box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreCheckData.cpp
box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreConfigVerify.cpp
box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreConfigVerify.h
box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreInfo.cpp
box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreInfo.h
box/gary/boxbackup-0.09-mod/lib/backupstore/StoreStructure.cpp
box/gary/boxbackup-0.09-mod/lib/backupstore/StoreStructure.h
box/gary/boxbackup-0.09-mod/lib/common/Archive.h
box/gary/boxbackup-0.09-mod/lib/common/BannerText.h
box/gary/boxbackup-0.09-mod/lib/common/BeginStructPackForWire.h
box/gary/boxbackup-0.09-mod/lib/common/Box.h
box/gary/boxbackup-0.09-mod/lib/common/BoxException.cpp
box/gary/boxbackup-0.09-mod/lib/common/BoxException.h
box/gary/boxbackup-0.09-mod/lib/common/BoxPlatform.h
box/gary/boxbackup-0.09-mod/lib/common/BoxPortsAndFiles.h
box/gary/boxbackup-0.09-mod/lib/common/BoxTime.cpp
box/gary/boxbackup-0.09-mod/lib/common/BoxTime.h
box/gary/boxbackup-0.09-mod/lib/common/BoxTimeToText.cpp
box/gary/boxbackup-0.09-mod/lib/common/BoxTimeToText.h
box/gary/boxbackup-0.09-mod/lib/common/BoxTimeToUnix.h
box/gary/boxbackup-0.09-mod/lib/common/CollectInBufferStream.cpp
box/gary/boxbackup-0.09-mod/lib/common/CollectInBufferStream.h
box/gary/boxbackup-0.09-mod/lib/common/CommonException.h
box/gary/boxbackup-0.09-mod/lib/common/Configuration.cpp
box/gary/boxbackup-0.09-mod/lib/common/Configuration.h
box/gary/boxbackup-0.09-mod/lib/common/Conversion.h
box/gary/boxbackup-0.09-mod/lib/common/ConversionString.cpp
box/gary/boxbackup-0.09-mod/lib/common/DebugAssertFailed.cpp
box/gary/boxbackup-0.09-mod/lib/common/DebugMemLeakFinder.cpp
box/gary/boxbackup-0.09-mod/lib/common/DebugPrintf.cpp
box/gary/boxbackup-0.09-mod/lib/common/EndStructPackForWire.h
box/gary/boxbackup-0.09-mod/lib/common/EventWatchFilesystemObject.cpp
box/gary/boxbackup-0.09-mod/lib/common/EventWatchFilesystemObject.h
box/gary/boxbackup-0.09-mod/lib/common/ExcludeList.cpp
box/gary/boxbackup-0.09-mod/lib/common/ExcludeList.h
box/gary/boxbackup-0.09-mod/lib/common/FdGetLine.cpp
box/gary/boxbackup-0.09-mod/lib/common/FdGetLine.h
box/gary/boxbackup-0.09-mod/lib/common/FileModificationTime.h
box/gary/boxbackup-0.09-mod/lib/common/FileStream.cpp
box/gary/boxbackup-0.09-mod/lib/common/FileStream.h
box/gary/boxbackup-0.09-mod/lib/common/Guards.h
box/gary/boxbackup-0.09-mod/lib/common/IOStream.cpp
box/gary/boxbackup-0.09-mod/lib/common/IOStream.h
box/gary/boxbackup-0.09-mod/lib/common/IOStreamGetLine.cpp
box/gary/boxbackup-0.09-mod/lib/common/IOStreamGetLine.h
box/gary/boxbackup-0.09-mod/lib/common/LinuxWorkaround.cpp
box/gary/boxbackup-0.09-mod/lib/common/LinuxWorkaround.h
box/gary/boxbackup-0.09-mod/lib/common/MainHelper.h
box/gary/boxbackup-0.09-mod/lib/common/MemBlockStream.cpp
box/gary/boxbackup-0.09-mod/lib/common/MemBlockStream.h
box/gary/boxbackup-0.09-mod/lib/common/MemLeakFindOff.h
box/gary/boxbackup-0.09-mod/lib/common/MemLeakFindOn.h
box/gary/boxbackup-0.09-mod/lib/common/MemLeakFinder.h
box/gary/boxbackup-0.09-mod/lib/common/NamedLock.cpp
box/gary/boxbackup-0.09-mod/lib/common/NamedLock.h
box/gary/boxbackup-0.09-mod/lib/common/PartialReadStream.cpp
box/gary/boxbackup-0.09-mod/lib/common/PartialReadStream.h
box/gary/boxbackup-0.09-mod/lib/common/ReadGatherStream.cpp
box/gary/boxbackup-0.09-mod/lib/common/ReadGatherStream.h
box/gary/boxbackup-0.09-mod/lib/common/StreamableMemBlock.cpp
box/gary/boxbackup-0.09-mod/lib/common/StreamableMemBlock.h
box/gary/boxbackup-0.09-mod/lib/common/TemporaryDirectory.h
box/gary/boxbackup-0.09-mod/lib/common/Test.h
box/gary/boxbackup-0.09-mod/lib/common/UnixUser.cpp
box/gary/boxbackup-0.09-mod/lib/common/UnixUser.h
box/gary/boxbackup-0.09-mod/lib/common/Utils.cpp
box/gary/boxbackup-0.09-mod/lib/common/Utils.h
box/gary/boxbackup-0.09-mod/lib/common/WaitForEvent.cpp
box/gary/boxbackup-0.09-mod/lib/common/WaitForEvent.h
box/gary/boxbackup-0.09-mod/lib/compress/Compress.h
box/gary/boxbackup-0.09-mod/lib/compress/CompressException.h
box/gary/boxbackup-0.09-mod/lib/compress/CompressStream.cpp
box/gary/boxbackup-0.09-mod/lib/compress/CompressStream.h
box/gary/boxbackup-0.09-mod/lib/crypto/CipherAES.cpp
box/gary/boxbackup-0.09-mod/lib/crypto/CipherAES.h
box/gary/boxbackup-0.09-mod/lib/crypto/CipherBlowfish.cpp
box/gary/boxbackup-0.09-mod/lib/crypto/CipherBlowfish.h
box/gary/boxbackup-0.09-mod/lib/crypto/CipherContext.cpp
box/gary/boxbackup-0.09-mod/lib/crypto/CipherContext.h
box/gary/boxbackup-0.09-mod/lib/crypto/CipherDescription.cpp
box/gary/boxbackup-0.09-mod/lib/crypto/CipherDescription.h
box/gary/boxbackup-0.09-mod/lib/crypto/CipherException.h
box/gary/boxbackup-0.09-mod/lib/crypto/MD5Digest.cpp
box/gary/boxbackup-0.09-mod/lib/crypto/MD5Digest.h
box/gary/boxbackup-0.09-mod/lib/crypto/Random.cpp
box/gary/boxbackup-0.09-mod/lib/crypto/Random.h
box/gary/boxbackup-0.09-mod/lib/crypto/RollingChecksum.cpp
box/gary/boxbackup-0.09-mod/lib/crypto/RollingChecksum.h
box/gary/boxbackup-0.09-mod/lib/raidfile/RaidFileController.cpp
box/gary/boxbackup-0.09-mod/lib/raidfile/RaidFileController.h
box/gary/boxbackup-0.09-mod/lib/raidfile/RaidFileException.h
box/gary/boxbackup-0.09-mod/lib/raidfile/RaidFileRead.cpp
box/gary/boxbackup-0.09-mod/lib/raidfile/RaidFileRead.h
box/gary/boxbackup-0.09-mod/lib/raidfile/RaidFileUtil.cpp
box/gary/boxbackup-0.09-mod/lib/raidfile/RaidFileUtil.h
box/gary/boxbackup-0.09-mod/lib/raidfile/RaidFileWrite.cpp
box/gary/boxbackup-0.09-mod/lib/raidfile/RaidFileWrite.h
box/gary/boxbackup-0.09-mod/lib/server/Daemon.cpp
box/gary/boxbackup-0.09-mod/lib/server/Daemon.h
box/gary/boxbackup-0.09-mod/lib/server/LocalProcessStream.cpp
box/gary/boxbackup-0.09-mod/lib/server/LocalProcessStream.h
box/gary/boxbackup-0.09-mod/lib/server/Protocol.cpp
box/gary/boxbackup-0.09-mod/lib/server/Protocol.h
box/gary/boxbackup-0.09-mod/lib/server/ProtocolObject.cpp
box/gary/boxbackup-0.09-mod/lib/server/ProtocolObject.h
box/gary/boxbackup-0.09-mod/lib/server/ProtocolUncertainStream.cpp
box/gary/boxbackup-0.09-mod/lib/server/ProtocolUncertainStream.h
box/gary/boxbackup-0.09-mod/lib/server/ProtocolWire.h
box/gary/boxbackup-0.09-mod/lib/server/SSLLib.cpp
box/gary/boxbackup-0.09-mod/lib/server/SSLLib.h
box/gary/boxbackup-0.09-mod/lib/server/ServerException.h
box/gary/boxbackup-0.09-mod/lib/server/ServerStream.h
box/gary/boxbackup-0.09-mod/lib/server/ServerTLS.h
box/gary/boxbackup-0.09-mod/lib/server/Socket.cpp
box/gary/boxbackup-0.09-mod/lib/server/Socket.h
box/gary/boxbackup-0.09-mod/lib/server/SocketListen.h
box/gary/boxbackup-0.09-mod/lib/server/SocketStream.cpp
box/gary/boxbackup-0.09-mod/lib/server/SocketStream.h
box/gary/boxbackup-0.09-mod/lib/server/SocketStreamTLS.cpp
box/gary/boxbackup-0.09-mod/lib/server/SocketStreamTLS.h
box/gary/boxbackup-0.09-mod/lib/server/TLSContext.cpp
box/gary/boxbackup-0.09-mod/lib/server/TLSContext.h
box/gary/boxbackup-0.09-mod/test/backupdiff/difftestfiles.cpp
box/gary/boxbackup-0.09-mod/test/backupdiff/testbackupdiff.cpp
box/gary/boxbackup-0.09-mod/test/backupstore/testbackupstore.cpp
box/gary/boxbackup-0.09-mod/test/backupstorefix/testbackupstorefix.cpp
box/gary/boxbackup-0.09-mod/test/backupstorepatch/testbackupstorepatch.cpp
box/gary/boxbackup-0.09-mod/test/basicserver/TestCommands.cpp
box/gary/boxbackup-0.09-mod/test/basicserver/TestContext.cpp
box/gary/boxbackup-0.09-mod/test/basicserver/TestContext.h
box/gary/boxbackup-0.09-mod/test/basicserver/testbasicserver.cpp
box/gary/boxbackup-0.09-mod/test/bbackupd/testbbackupd.cpp
box/gary/boxbackup-0.09-mod/test/common/testcommon.cpp
box/gary/boxbackup-0.09-mod/test/compress/testcompress.cpp
box/gary/boxbackup-0.09-mod/test/crypto/testcrypto.cpp
box/gary/boxbackup-0.09-mod/test/raidfile/Darwin-SYS.h
box/gary/boxbackup-0.09-mod/test/raidfile/intercept.cpp
box/gary/boxbackup-0.09-mod/test/raidfile/testraidfile.cpp
Log:
* boxbackup-0.09-mod
- Fixed inconsistent line endings (now all Unix)
- Set svn:eol-style to "native" for *.cpp and *.h
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbackupctl/bbackupctl.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientContext.cpp
===================================================================
--- box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientContext.cpp 2006-01-17 22:27:22 UTC (rev 320)
+++ box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientContext.cpp 2006-01-17 22:43:33 UTC (rev 321)
@@ -49,8 +49,8 @@
#include "Box.h"
#include <syslog.h>
-#include <signal.h>
-#include <sys/time.h>
+#include <signal.h>
+#include <sys/time.h>
#include "BoxPortsAndFiles.h"
#include "BoxTime.h"
@@ -61,7 +61,7 @@
#include "BackupStoreException.h"
#include "BackupDaemon.h"
#include "autogen_BackupProtocolClient.h"
-#include "BackupStoreFile.h"
+#include "BackupStoreFile.h"
#include "MemLeakFindOn.h"
@@ -88,7 +88,7 @@
mpNewIDMap(0),
mStorageLimitExceeded(false),
mpExcludeFiles(0),
- mpExcludeDirs(0),
+ mpExcludeDirs(0),
mbIsManaged(false)
{
}
@@ -492,171 +492,171 @@
// Found
return true;
}
-
-//
-//
-//
-
-// maximum time to spend diffing
-static int sMaximumDiffTime = 10;
-// maximum time of SSL inactivity (keep-alive interval)
-static int sKeepAliveTime = 0;
-// total time elapsed to keep track of what is going on
-static time_t sTimeMgmtEpoch = 0;
-
-void BackupClientContext::SetMaximumDiffingTime(int iSeconds)
-{
- sMaximumDiffTime = iSeconds < 0 ? 0 : iSeconds;
- TRACE1("Set maximum diffing time to %d seconds\n", sMaximumDiffTime);
-}
-
-void BackupClientContext::SetKeepAliveTime(int iSeconds)
-{
- sKeepAliveTime = iSeconds < 0 ? 0 : iSeconds;
- TRACE1("Set keep-alive time to %d seconds\n", sKeepAliveTime);
-}
-
-static BackupClientContext* pThisCtxInst = NULL;
-
-// --------------------------------------------------------------------------
-//
-// Function
-// Name: static TimerSigHandler(int)
-// Purpose: Signal handler
-// Created: 19/3/04
-//
-// --------------------------------------------------------------------------
-void TimerSigHandler(int iUnused)
-{
- ASSERT(pThisCtxInst);
- ASSERT(sTimeMgmtEpoch > 0);
-
- time_t tTotalRunIntvl = time(NULL) - sTimeMgmtEpoch;
- if (sMaximumDiffTime > 0 && tTotalRunIntvl >= sMaximumDiffTime)
- {
- TRACE0("MaximumDiffingTime reached - suspending file diff\n");
- BackupStoreFile::SuspendFileDiff();
- }
- else if (sKeepAliveTime > 0)
- {
- // well, we have only two sources of timer events...
- TRACE0("KeepAliveTime reached - initiating keep-alive\n");
- pThisCtxInst->DoKeepAlive();
- }
-}
-
-// --------------------------------------------------------------------------
-//
-// Function
-// Name: BackupClientContext::ManageDiffProcess()
-// Purpose: Initiates a file diff control timer
-// Created: 04/19/2005
-//
-// --------------------------------------------------------------------------
-void BackupClientContext::ManageDiffProcess()
-{
- if (mbIsManaged || !mpConnection)
- return;
-
- ASSERT(pThisCtxInst == NULL);
- ASSERT(sTimeMgmtEpoch == 0);
-
-#ifdef PLATFORM_CYGWIN
- ::signal(SIGALRM, TimerSigHandler);
-#else
- ::signal(SIGVTALRM, TimerSigHandler);
-#endif // PLATFORM_CYGWIN
-
- struct itimerval timeout;
- memset(&timeout, 0, sizeof(timeout));
-
- //
- //
- //
- if (sMaximumDiffTime <= 0 && sKeepAliveTime <= 0)
- {
- TRACE0("Diff control not requested - letting things run wild\n");
- return;
- }
- else if (sMaximumDiffTime > 0 && sKeepAliveTime > 0)
- {
- timeout.it_value.tv_sec = sKeepAliveTime < sMaximumDiffTime ? sKeepAliveTime : sMaximumDiffTime;
- timeout.it_interval.tv_sec = sKeepAliveTime < sMaximumDiffTime ? sKeepAliveTime : sMaximumDiffTime;
- }
- else
- {
- timeout.it_value.tv_sec = sKeepAliveTime > 0 ? sKeepAliveTime : sMaximumDiffTime;
- timeout.it_interval.tv_sec = sKeepAliveTime > 0 ? sKeepAliveTime : sMaximumDiffTime;
- }
-
- // avoid race
- pThisCtxInst = this;
- sTimeMgmtEpoch = time(NULL);
-
-#ifdef PLATFORM_CYGWIN
- if(::setitimer(ITIMER_REAL, &timeout, NULL) != 0)
-#else
- if(::setitimer(ITIMER_VIRTUAL, &timeout, NULL) != 0)
-#endif // PLATFORM_CYGWIN
- {
- sTimeMgmtEpoch = 0;
- pThisCtxInst = NULL;
-
- TRACE0("WARNING: couldn't set file diff control timeout\n");
- THROW_EXCEPTION(BackupStoreException, Internal)
- }
-
- mbIsManaged = true;
- TRACE0("Initiated timer for file diff control\n");
-}
-
-// --------------------------------------------------------------------------
-//
-// Function
-// Name: BackupClientContext::UnManageDiffProcess()
-// Purpose: suspends file diff control timer
-// Created: 04/19/2005
-//
-// --------------------------------------------------------------------------
-void BackupClientContext::UnManageDiffProcess()
-{
- if (!mbIsManaged /* don't test for active connection, just do it */)
- return;
-
- ASSERT(pThisCtxInst != NULL);
-
- struct itimerval timeout;
- memset(&timeout, 0, sizeof(timeout));
-
-#ifdef PLATFORM_CYGWIN
- if(::setitimer(ITIMER_REAL, &timeout, NULL) != 0)
-#else
- if(::setitimer(ITIMER_VIRTUAL, &timeout, NULL) != 0)
-#endif // PLATFORM_CYGWIN
- {
- TRACE0("WARNING: couldn't clear file diff control timeout\n");
- THROW_EXCEPTION(BackupStoreException, Internal)
- }
-
- mbIsManaged = false;
- pThisCtxInst = NULL;
- sTimeMgmtEpoch = 0;
-
- TRACE0("Suspended timer for file diff control\n");
-}
-
-// --------------------------------------------------------------------------
-//
-// Function
-// Name: BackupClientContext::DoKeepAlive()
-// Purpose: Does something inconsequential over the SSL link to keep it up
-// Created: 04/19/2005
-//
-// --------------------------------------------------------------------------
-void BackupClientContext::DoKeepAlive()
-{
- if (!mpConnection)
- return;
-
- mpConnection->QueryGetIsAlive();
-}
+
+//
+//
+//
+
+// maximum time to spend diffing
+static int sMaximumDiffTime = 10;
+// maximum time of SSL inactivity (keep-alive interval)
+static int sKeepAliveTime = 0;
+// total time elapsed to keep track of what is going on
+static time_t sTimeMgmtEpoch = 0;
+
+void BackupClientContext::SetMaximumDiffingTime(int iSeconds)
+{
+ sMaximumDiffTime = iSeconds < 0 ? 0 : iSeconds;
+ TRACE1("Set maximum diffing time to %d seconds\n", sMaximumDiffTime);
+}
+
+void BackupClientContext::SetKeepAliveTime(int iSeconds)
+{
+ sKeepAliveTime = iSeconds < 0 ? 0 : iSeconds;
+ TRACE1("Set keep-alive time to %d seconds\n", sKeepAliveTime);
+}
+
+static BackupClientContext* pThisCtxInst = NULL;
+
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: static TimerSigHandler(int)
+// Purpose: Signal handler
+// Created: 19/3/04
+//
+// --------------------------------------------------------------------------
+void TimerSigHandler(int iUnused)
+{
+ ASSERT(pThisCtxInst);
+ ASSERT(sTimeMgmtEpoch > 0);
+
+ time_t tTotalRunIntvl = time(NULL) - sTimeMgmtEpoch;
+ if (sMaximumDiffTime > 0 && tTotalRunIntvl >= sMaximumDiffTime)
+ {
+ TRACE0("MaximumDiffingTime reached - suspending file diff\n");
+ BackupStoreFile::SuspendFileDiff();
+ }
+ else if (sKeepAliveTime > 0)
+ {
+ // well, we have only two sources of timer events...
+ TRACE0("KeepAliveTime reached - initiating keep-alive\n");
+ pThisCtxInst->DoKeepAlive();
+ }
+}
+
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: BackupClientContext::ManageDiffProcess()
+// Purpose: Initiates a file diff control timer
+// Created: 04/19/2005
+//
+// --------------------------------------------------------------------------
+void BackupClientContext::ManageDiffProcess()
+{
+ if (mbIsManaged || !mpConnection)
+ return;
+
+ ASSERT(pThisCtxInst == NULL);
+ ASSERT(sTimeMgmtEpoch == 0);
+
+#ifdef PLATFORM_CYGWIN
+ ::signal(SIGALRM, TimerSigHandler);
+#else
+ ::signal(SIGVTALRM, TimerSigHandler);
+#endif // PLATFORM_CYGWIN
+
+ struct itimerval timeout;
+ memset(&timeout, 0, sizeof(timeout));
+
+ //
+ //
+ //
+ if (sMaximumDiffTime <= 0 && sKeepAliveTime <= 0)
+ {
+ TRACE0("Diff control not requested - letting things run wild\n");
+ return;
+ }
+ else if (sMaximumDiffTime > 0 && sKeepAliveTime > 0)
+ {
+ timeout.it_value.tv_sec = sKeepAliveTime < sMaximumDiffTime ? sKeepAliveTime : sMaximumDiffTime;
+ timeout.it_interval.tv_sec = sKeepAliveTime < sMaximumDiffTime ? sKeepAliveTime : sMaximumDiffTime;
+ }
+ else
+ {
+ timeout.it_value.tv_sec = sKeepAliveTime > 0 ? sKeepAliveTime : sMaximumDiffTime;
+ timeout.it_interval.tv_sec = sKeepAliveTime > 0 ? sKeepAliveTime : sMaximumDiffTime;
+ }
+
+ // avoid race
+ pThisCtxInst = this;
+ sTimeMgmtEpoch = time(NULL);
+
+#ifdef PLATFORM_CYGWIN
+ if(::setitimer(ITIMER_REAL, &timeout, NULL) != 0)
+#else
+ if(::setitimer(ITIMER_VIRTUAL, &timeout, NULL) != 0)
+#endif // PLATFORM_CYGWIN
+ {
+ sTimeMgmtEpoch = 0;
+ pThisCtxInst = NULL;
+
+ TRACE0("WARNING: couldn't set file diff control timeout\n");
+ THROW_EXCEPTION(BackupStoreException, Internal)
+ }
+
+ mbIsManaged = true;
+ TRACE0("Initiated timer for file diff control\n");
+}
+
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: BackupClientContext::UnManageDiffProcess()
+// Purpose: suspends file diff control timer
+// Created: 04/19/2005
+//
+// --------------------------------------------------------------------------
+void BackupClientContext::UnManageDiffProcess()
+{
+ if (!mbIsManaged /* don't test for active connection, just do it */)
+ return;
+
+ ASSERT(pThisCtxInst != NULL);
+
+ struct itimerval timeout;
+ memset(&timeout, 0, sizeof(timeout));
+
+#ifdef PLATFORM_CYGWIN
+ if(::setitimer(ITIMER_REAL, &timeout, NULL) != 0)
+#else
+ if(::setitimer(ITIMER_VIRTUAL, &timeout, NULL) != 0)
+#endif // PLATFORM_CYGWIN
+ {
+ TRACE0("WARNING: couldn't clear file diff control timeout\n");
+ THROW_EXCEPTION(BackupStoreException, Internal)
+ }
+
+ mbIsManaged = false;
+ pThisCtxInst = NULL;
+ sTimeMgmtEpoch = 0;
+
+ TRACE0("Suspended timer for file diff control\n");
+}
+
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: BackupClientContext::DoKeepAlive()
+// Purpose: Does something inconsequential over the SSL link to keep it up
+// Created: 04/19/2005
+//
+// --------------------------------------------------------------------------
+void BackupClientContext::DoKeepAlive()
+{
+ if (!mpConnection)
+ return;
+
+ mpConnection->QueryGetIsAlive();
+}
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientContext.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientContext.h
===================================================================
--- box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientContext.h 2006-01-17 22:27:22 UTC (rev 320)
+++ box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientContext.h 2006-01-17 22:43:33 UTC (rev 321)
@@ -172,56 +172,56 @@
bool FindFilename(int64_t ObjectID, int64_t ContainingDirectory, std::string &rPathOut, bool &rIsDirectoryOut,
bool &rIsCurrentVersionOut, box_time_t *pModTimeOnServer = 0, box_time_t *pAttributesHashOnServer = 0,
BackupStoreFilenameClear *pLeafname = 0); // not const as may connect to server
-
- // --------------------------------------------------------------------------
- //
- // Function
- // Name: BackupClientContext::SetMaximumDiffingTime()
- // Purpose: Sets the maximum time that will be spent diffing a file
- // Created: 04/19/2005
- //
- // --------------------------------------------------------------------------
- static void SetMaximumDiffingTime(int iSeconds);
-
- // --------------------------------------------------------------------------
- //
- // Function
- // Name: BackupClientContext::SetKeepAliveTime()
- // Purpose: Sets the time interval for repetitive keep-alive operation
- // Created: 04/19/2005
- //
- // --------------------------------------------------------------------------
- static void SetKeepAliveTime(int iSeconds);
- // --------------------------------------------------------------------------
- //
- // Function
- // Name: BackupClientContext::ManageDiffProcess()
- // Purpose: Initiates an SSL connection/session keep-alive process
- // Created: 04/19/2005
- //
- // --------------------------------------------------------------------------
- void ManageDiffProcess();
-
- // --------------------------------------------------------------------------
- //
- // Function
- // Name: BackupClientContext::UnManageDiffProcess()
- // Purpose: Suspends an SSL connection/session keep-alive process
- // Created: 04/19/2005
- //
- // --------------------------------------------------------------------------
- void UnManageDiffProcess();
-
- // --------------------------------------------------------------------------
- //
- // Function
- // Name: BackupClientContext::DoKeepAlive()
- // Purpose: Does something inconsequential over the SSL link to keep it up
- // Created: 04/19/2005
- //
- // --------------------------------------------------------------------------
- void DoKeepAlive();
+ // --------------------------------------------------------------------------
+ //
+ // Function
+ // Name: BackupClientContext::SetMaximumDiffingTime()
+ // Purpose: Sets the maximum time that will be spent diffing a file
+ // Created: 04/19/2005
+ //
+ // --------------------------------------------------------------------------
+ static void SetMaximumDiffingTime(int iSeconds);
+
+ // --------------------------------------------------------------------------
+ //
+ // Function
+ // Name: BackupClientContext::SetKeepAliveTime()
+ // Purpose: Sets the time interval for repetitive keep-alive operation
+ // Created: 04/19/2005
+ //
+ // --------------------------------------------------------------------------
+ static void SetKeepAliveTime(int iSeconds);
+
+ // --------------------------------------------------------------------------
+ //
+ // Function
+ // Name: BackupClientContext::ManageDiffProcess()
+ // Purpose: Initiates an SSL connection/session keep-alive process
+ // Created: 04/19/2005
+ //
+ // --------------------------------------------------------------------------
+ void ManageDiffProcess();
+
+ // --------------------------------------------------------------------------
+ //
+ // Function
+ // Name: BackupClientContext::UnManageDiffProcess()
+ // Purpose: Suspends an SSL connection/session keep-alive process
+ // Created: 04/19/2005
+ //
+ // --------------------------------------------------------------------------
+ void UnManageDiffProcess();
+
+ // --------------------------------------------------------------------------
+ //
+ // Function
+ // Name: BackupClientContext::DoKeepAlive()
+ // Purpose: Does something inconsequential over the SSL link to keep it up
+ // Created: 04/19/2005
+ //
+ // --------------------------------------------------------------------------
+ void DoKeepAlive();
private:
BackupDaemon &mrDaemon;
TLSContext &mrTLSContext;
@@ -236,8 +236,8 @@
BackupClientInodeToIDMap *mpNewIDMap;
bool mStorageLimitExceeded;
ExcludeList *mpExcludeFiles;
- ExcludeList *mpExcludeDirs;
-
+ ExcludeList *mpExcludeDirs;
+
bool mbIsManaged;
};
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientContext.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientDeleteList.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientDeleteList.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientDirectoryRecord.cpp
===================================================================
--- box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientDirectoryRecord.cpp 2006-01-17 22:27:22 UTC (rev 320)
+++ box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientDirectoryRecord.cpp 2006-01-17 22:43:33 UTC (rev 321)
@@ -1116,23 +1116,23 @@
{
// Found an old version -- get the index
std::auto_ptr<IOStream> blockIndexStream(connection.ReceiveStream());
-
+
//
- // Diff the file
- //
-
- rParams.mrContext.ManageDiffProcess();
+ // Diff the file
+ //
+ rParams.mrContext.ManageDiffProcess();
+
bool isCompletelyDifferent = false;
std::auto_ptr<IOStream> patchStream(BackupStoreFile::EncodeFileDiff(rFilename.c_str(),
mObjectID, /* containing directory */
rStoreFilename, diffFromID, *blockIndexStream,
connection.GetTimeout(), 0 /* not interested in the modification time */, &isCompletelyDifferent));
-
- rParams.mrContext.UnManageDiffProcess();
-
+
+ rParams.mrContext.UnManageDiffProcess();
+
//
- // Upload the patch to the store
+ // Upload the patch to the store
//
std::auto_ptr<BackupProtocolClientSuccess> stored(connection.QueryStoreFile(mObjectID, ModificationTime,
AttributesHash, isCompletelyDifferent?(0):(diffFromID), rStoreFilename, *patchStream));
@@ -1158,9 +1158,9 @@
}
}
catch(BoxException &e)
- {
- rParams.mrContext.UnManageDiffProcess();
-
+ {
+ rParams.mrContext.UnManageDiffProcess();
+
if(e.GetType() == ConnectionException::ExceptionType && e.GetSubType() == ConnectionException::Protocol_UnexpectedReply)
{
// Check and see what error the protocol has -- as it might be an error...
@@ -1172,7 +1172,7 @@
// The hard limit was exceeded on the server, notify!
rParams.mrDaemon.NotifySysadmin(BackupDaemon::NotifyEvent_StoreFull);
}
- }
+ }
// Send the error on it's way
throw;
@@ -1242,147 +1242,147 @@
{
}
-// --------------------------------------------------------------------------
-//
-// Function
-// Name: BackupClientDirectoryRecord::Deserialize(Archive & rArchive)
-// Purpose: Deserializes this object instance from a stream of bytes, using an Archive abstraction.
-//
-// Created: 2005/04/11
-//
-// --------------------------------------------------------------------------
-void BackupClientDirectoryRecord::Deserialize(Archive & rArchive)
-{
- // Make deletion recursive
- DeleteSubDirectories();
-
- // Delete maps
- if(mpPendingEntries != 0)
- {
- delete mpPendingEntries;
- mpPendingEntries = 0;
- }
-
- //
- //
- //
- rArchive >> mObjectID >> mSubDirName >> mInitialSyncDone >> mSyncDone;
-
- //
- //
- //
- int64_t iCount = 0;
- rArchive.Get(iCount);
-
- if (iCount != sizeof(mStateChecksum)/sizeof(mStateChecksum[0]))
- {
- // we have some kind of internal system representation change: throw for now
- THROW_EXCEPTION(CommonException, Internal)
- }
-
- for (int v = 0; v < iCount; v++)
- /**** LOAD ****/ rArchive.Get(mStateChecksum[v]);
-
- //
- //
- //
- iCount = 0;
- rArchive.Get(iCount);
-
- if (iCount > 0)
- {
- /**** LOAD ****/ mpPendingEntries = new std::map<std::string, box_time_t>;
- if (!mpPendingEntries)
- throw std::bad_alloc();
-
- for (int v = 0; v < iCount; v++)
- {
- std::string strItem;
- box_time_t btItem;
-
- rArchive >> strItem >> btItem;
- (*mpPendingEntries)[strItem] = btItem;
- }
- }
-
- //
- //
- //
- iCount = 0;
- rArchive.Get(iCount);
-
- if (iCount > 0)
- {
- for (int v = 0; v < iCount; v++)
- {
- std::string strItem;
- rArchive.Get(strItem);
-
- BackupClientDirectoryRecord* pSubDirRecord = new BackupClientDirectoryRecord(0, ""); // will be deserialized anyway, give it id 0 for now
- if (!pSubDirRecord)
- throw std::bad_alloc();
-
- /***** RECURSE *****/
- pSubDirRecord->Deserialize(rArchive);
- mSubDirectories[strItem] = pSubDirRecord;
- }
- }
-}
-
-// --------------------------------------------------------------------------
-//
-// Function
-// Name: BackupClientDirectoryRecord::Serialize(Archive & rArchive)
-// Purpose: Serializes this object instance into a stream of bytes, using an Archive abstraction.
-//
-// Created: 2005/04/11
-//
-// --------------------------------------------------------------------------
-void BackupClientDirectoryRecord::Serialize(Archive & rArchive) const
-{
- //
- //
- //
- rArchive << mObjectID << mSubDirName << mInitialSyncDone << mSyncDone;
-
- //
- //
- //
- int64_t iCount = 0;
-
- iCount = sizeof(mStateChecksum)/sizeof(mStateChecksum[0]);
- rArchive.Add(iCount); // add count to see if we have crossed build-level mods
- for (int v = 0; v < iCount; v++)
- rArchive.Add(mStateChecksum[v]);
-
- //
- //
- //
- if (!mpPendingEntries)
- {
- iCount = 0;
- rArchive.Add(iCount);
- }
- else
- {
- iCount = mpPendingEntries->size();
- rArchive.Add(iCount);
-
- for (std::map<std::string, box_time_t>::const_iterator i = mpPendingEntries->begin(); i != mpPendingEntries->end(); i++)
- rArchive << (*i).first << (*i).second;
- }
- //
- //
- //
- iCount = mSubDirectories.size();
- rArchive.Add(iCount);
-
- for (std::map<std::string, BackupClientDirectoryRecord*>::const_iterator i = mSubDirectories.begin(); i != mSubDirectories.end(); i++)
- {
- const BackupClientDirectoryRecord* pSubItem = (*i).second;
- ASSERT(pSubItem);
-
- rArchive.Add((*i).first);
- pSubItem->Serialize(rArchive);
- }
-}
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: BackupClientDirectoryRecord::Deserialize(Archive & rArchive)
+// Purpose: Deserializes this object instance from a stream of bytes, using an Archive abstraction.
+//
+// Created: 2005/04/11
+//
+// --------------------------------------------------------------------------
+void BackupClientDirectoryRecord::Deserialize(Archive & rArchive)
+{
+ // Make deletion recursive
+ DeleteSubDirectories();
+
+ // Delete maps
+ if(mpPendingEntries != 0)
+ {
+ delete mpPendingEntries;
+ mpPendingEntries = 0;
+ }
+
+ //
+ //
+ //
+ rArchive >> mObjectID >> mSubDirName >> mInitialSyncDone >> mSyncDone;
+
+ //
+ //
+ //
+ int64_t iCount = 0;
+ rArchive.Get(iCount);
+
+ if (iCount != sizeof(mStateChecksum)/sizeof(mStateChecksum[0]))
+ {
+ // we have some kind of internal system representation change: throw for now
+ THROW_EXCEPTION(CommonException, Internal)
+ }
+
+ for (int v = 0; v < iCount; v++)
+ /**** LOAD ****/ rArchive.Get(mStateChecksum[v]);
+
+ //
+ //
+ //
+ iCount = 0;
+ rArchive.Get(iCount);
+
+ if (iCount > 0)
+ {
+ /**** LOAD ****/ mpPendingEntries = new std::map<std::string, box_time_t>;
+ if (!mpPendingEntries)
+ throw std::bad_alloc();
+
+ for (int v = 0; v < iCount; v++)
+ {
+ std::string strItem;
+ box_time_t btItem;
+
+ rArchive >> strItem >> btItem;
+ (*mpPendingEntries)[strItem] = btItem;
+ }
+ }
+
+ //
+ //
+ //
+ iCount = 0;
+ rArchive.Get(iCount);
+
+ if (iCount > 0)
+ {
+ for (int v = 0; v < iCount; v++)
+ {
+ std::string strItem;
+ rArchive.Get(strItem);
+
+ BackupClientDirectoryRecord* pSubDirRecord = new BackupClientDirectoryRecord(0, ""); // will be deserialized anyway, give it id 0 for now
+ if (!pSubDirRecord)
+ throw std::bad_alloc();
+
+ /***** RECURSE *****/
+ pSubDirRecord->Deserialize(rArchive);
+ mSubDirectories[strItem] = pSubDirRecord;
+ }
+ }
+}
+
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: BackupClientDirectoryRecord::Serialize(Archive & rArchive)
+// Purpose: Serializes this object instance into a stream of bytes, using an Archive abstraction.
+//
+// Created: 2005/04/11
+//
+// --------------------------------------------------------------------------
+void BackupClientDirectoryRecord::Serialize(Archive & rArchive) const
+{
+ //
+ //
+ //
+ rArchive << mObjectID << mSubDirName << mInitialSyncDone << mSyncDone;
+
+ //
+ //
+ //
+ int64_t iCount = 0;
+
+ iCount = sizeof(mStateChecksum)/sizeof(mStateChecksum[0]);
+ rArchive.Add(iCount); // add count to see if we have crossed build-level mods
+ for (int v = 0; v < iCount; v++)
+ rArchive.Add(mStateChecksum[v]);
+
+ //
+ //
+ //
+ if (!mpPendingEntries)
+ {
+ iCount = 0;
+ rArchive.Add(iCount);
+ }
+ else
+ {
+ iCount = mpPendingEntries->size();
+ rArchive.Add(iCount);
+
+ for (std::map<std::string, box_time_t>::const_iterator i = mpPendingEntries->begin(); i != mpPendingEntries->end(); i++)
+ rArchive << (*i).first << (*i).second;
+ }
+ //
+ //
+ //
+ iCount = mSubDirectories.size();
+ rArchive.Add(iCount);
+
+ for (std::map<std::string, BackupClientDirectoryRecord*>::const_iterator i = mSubDirectories.begin(); i != mSubDirectories.end(); i++)
+ {
+ const BackupClientDirectoryRecord* pSubItem = (*i).second;
+ ASSERT(pSubItem);
+
+ rArchive.Add((*i).first);
+ pSubItem->Serialize(rArchive);
+ }
+}
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientDirectoryRecord.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientDirectoryRecord.h
===================================================================
--- box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientDirectoryRecord.h 2006-01-17 22:27:22 UTC (rev 320)
+++ box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientDirectoryRecord.h 2006-01-17 22:43:33 UTC (rev 321)
@@ -56,9 +56,9 @@
#include "BackupClientFileAttributes.h"
#include "BackupStoreDirectory.h"
#include "MD5Digest.h"
-
-#include "Archive.h"
+#include "Archive.h"
+
class BackupClientContext;
class BackupDaemon;
@@ -74,9 +74,9 @@
{
public:
BackupClientDirectoryRecord(int64_t ObjectID, const std::string &rSubDirName);
- ~BackupClientDirectoryRecord();
-
- void Deserialize(Archive & rArchive);
+ ~BackupClientDirectoryRecord();
+
+ void Deserialize(Archive & rArchive);
void Serialize(Archive & rArchive) const;
private:
BackupClientDirectoryRecord(const BackupClientDirectoryRecord &);
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientDirectoryRecord.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientInodeToIDMap.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupClientInodeToIDMap.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupDaemon.cpp
===================================================================
--- box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupDaemon.cpp 2006-01-17 22:27:22 UTC (rev 320)
+++ box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupDaemon.cpp 2006-01-17 22:43:33 UTC (rev 321)
@@ -97,7 +97,7 @@
// Make the actual sync period have a little bit of extra time, up to a 64th of the main sync period.
// This prevents repetative cycles of load on the server
#define SYNC_PERIOD_RANDOM_EXTRA_TIME_SHIFT_BY 6
-
+
// --------------------------------------------------------------------------
//
// Function
@@ -314,10 +314,10 @@
{
BackupClientContext::SetMaximumDiffingTime(conf.GetKeyValueInt("MaximumDiffingTime"));
}
- if(conf.KeyExists("KeepAliveTime"))
- {
- BackupClientContext::SetKeepAliveTime(conf.GetKeyValueInt("KeepAliveTime"));
- }
+ if(conf.KeyExists("KeepAliveTime"))
+ {
+ BackupClientContext::SetKeepAliveTime(conf.GetKeyValueInt("KeepAliveTime"));
+ }
// Setup various timings
@@ -340,16 +340,16 @@
// When the last sync started (only updated if the store was not full when the sync ended)
box_time_t lastSyncTime = 0;
-
- // And what's the current client store marker?
- int64_t clientStoreMarker = BackupClientContext::ClientStoreMarker_NotKnown; // haven't contacted the store yet
-
- // --------------------------------------------------------------------------------------------
-
- DeserializeStoreObjectInfo(clientStoreMarker, lastSyncTime, nextSyncTime);
+
+ // And what's the current client store marker?
+ int64_t clientStoreMarker = BackupClientContext::ClientStoreMarker_NotKnown; // haven't contacted the store yet
// --------------------------------------------------------------------------------------------
+ DeserializeStoreObjectInfo(clientStoreMarker, lastSyncTime, nextSyncTime);
+
+ // --------------------------------------------------------------------------------------------
+
// Set state
SetState(State_Idle);
@@ -548,14 +548,14 @@
CommitIDMapsAfterSync();
// Log
- ::syslog(LOG_INFO, "Finished scan of local files");
-
- // --------------------------------------------------------------------------------------------
-
- // We had a successful backup, save the store info
- SerializeStoreObjectInfo(clientStoreMarker, lastSyncTime, nextSyncTime);
-
- // --------------------------------------------------------------------------------------------
+ ::syslog(LOG_INFO, "Finished scan of local files");
+
+ // --------------------------------------------------------------------------------------------
+
+ // We had a successful backup, save the store info
+ SerializeStoreObjectInfo(clientStoreMarker, lastSyncTime, nextSyncTime);
+
+ // --------------------------------------------------------------------------------------------
}
catch(BoxException &e)
{
@@ -1605,19 +1605,19 @@
mUnusedRootDirEntries.clear();
}
-// --------------------------------------------------------------------------
-
-typedef struct
-{
- int32_t mMagicValue; // also the version number
- int32_t mNumEntries;
- int64_t mObjectID; // this object ID
- int64_t mContainerID; // ID of container
- uint64_t mAttributesModTime;
- int32_t mOptionsPresent; // bit mask of optional sections / features present
-
-} loc_StreamFormat;
+// --------------------------------------------------------------------------
+typedef struct
+{
+ int32_t mMagicValue; // also the version number
+ int32_t mNumEntries;
+ int64_t mObjectID; // this object ID
+ int64_t mContainerID; // ID of container
+ uint64_t mAttributesModTime;
+ int32_t mOptionsPresent; // bit mask of optional sections / features present
+
+} loc_StreamFormat;
+
// --------------------------------------------------------------------------
//
// Function
@@ -1625,7 +1625,7 @@
// Purpose: Constructor
// Created: 11/11/03
//
-// --------------------------------------------------------------------------
+// --------------------------------------------------------------------------
BackupDaemon::Location::Location()
: mIDMapIndex(0),
@@ -1656,178 +1656,178 @@
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 >> mName >> mPath >> mIDMapIndex;
-
- //
- //
- //
- int64_t aMagicMarker = 0;
- rArchive.Get(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(CommonException, Internal)
- }
-
- //
- //
- //
- rArchive.Get(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(CommonException, Internal)
- }
-
- //
- //
- //
- rArchive.Get(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(CommonException, Internal)
- }
-}
-
-// --------------------------------------------------------------------------
-//
-// 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 << mName << mPath << mIDMapIndex;
-
- //
- //
- //
- if (mpDirectoryRecord.get() == NULL)
- {
- int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_NOOP;
- rArchive.Add(aMagicMarker);
- }
- else
- {
- int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_RECURSE; // be explicit about whether recursion follows
- rArchive.Add(aMagicMarker);
-
- mpDirectoryRecord->Serialize(rArchive);
- }
-
- //
- //
- //
- if (!mpExcludeFiles)
- {
- int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_NOOP;
- rArchive.Add(aMagicMarker);
- }
- else
- {
- int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_RECURSE; // be explicit about whether recursion follows
- rArchive.Add(aMagicMarker);
-
- mpExcludeFiles->Serialize(rArchive);
- }
-
- //
- //
- //
- if (!mpExcludeDirs)
- {
- int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_NOOP;
- rArchive.Add(aMagicMarker);
- }
- else
- {
- int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_RECURSE; // be explicit about whether recursion follows
- rArchive.Add(aMagicMarker);
-
- mpExcludeDirs->Serialize(rArchive);
- }
-}
// --------------------------------------------------------------------------
//
// 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 >> mName >> mPath >> mIDMapIndex;
+
+ //
+ //
+ //
+ int64_t aMagicMarker = 0;
+ rArchive.Get(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(CommonException, Internal)
+ }
+
+ //
+ //
+ //
+ rArchive.Get(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(CommonException, Internal)
+ }
+
+ //
+ //
+ //
+ rArchive.Get(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(CommonException, Internal)
+ }
+}
+
+// --------------------------------------------------------------------------
+//
+// 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 << mName << mPath << mIDMapIndex;
+
+ //
+ //
+ //
+ if (mpDirectoryRecord.get() == NULL)
+ {
+ int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_NOOP;
+ rArchive.Add(aMagicMarker);
+ }
+ else
+ {
+ int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_RECURSE; // be explicit about whether recursion follows
+ rArchive.Add(aMagicMarker);
+
+ mpDirectoryRecord->Serialize(rArchive);
+ }
+
+ //
+ //
+ //
+ if (!mpExcludeFiles)
+ {
+ int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_NOOP;
+ rArchive.Add(aMagicMarker);
+ }
+ else
+ {
+ int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_RECURSE; // be explicit about whether recursion follows
+ rArchive.Add(aMagicMarker);
+
+ mpExcludeFiles->Serialize(rArchive);
+ }
+
+ //
+ //
+ //
+ if (!mpExcludeDirs)
+ {
+ int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_NOOP;
+ rArchive.Add(aMagicMarker);
+ }
+ else
+ {
+ int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_RECURSE; // be explicit about whether recursion follows
+ rArchive.Add(aMagicMarker);
+
+ mpExcludeDirs->Serialize(rArchive);
+ }
+}
+
+// --------------------------------------------------------------------------
+//
+// Function
// Name: BackupDaemon::CommandSocketInfo::CommandSocketInfo()
// Purpose: Constructor
// Created: 18/2/04
@@ -1855,192 +1855,192 @@
mpGetLine = 0;
}
}
-
-// --------------------------------------------------------------------------
-//
-// Function
-// Name: BackupDaemon::SerializeStoreObjectInfo(int64_t aClientStoreMarker, box_time_t theLastSyncTime, box_time_t theNextSyncTime)
-// Purpose: Serializes remote directory and file information into a stream of bytes, using an Archive abstraction.
-//
-// Created: 2005/04/11
-//
-// --------------------------------------------------------------------------
-
-static const int STOREOBJECTINFO_MAGIC_ID_VALUE = 0x7777525F;
-static const std::string STOREOBJECTINFO_MAGIC_ID_STRING = "BBACKUPD-STATE";
-static const int STOREOBJECTINFO_VERSION = 1;
-
-void BackupDaemon::SerializeStoreObjectInfo(int64_t aClientStoreMarker, box_time_t theLastSyncTime, box_time_t theNextSyncTime) const
-{
- if(!GetConfiguration().KeyExists("StoreObjectInfoFile") || GetConfiguration().GetKeyValue("StoreObjectInfoFile").size() <= 0)
- return;
-
- try
- {
- FileStream aFile(GetConfiguration().GetKeyValue("StoreObjectInfoFile").c_str(), O_WRONLY | O_CREAT | O_TRUNC);
- IOStreamArchive anArchive(aFile, 0);
-
- anArchive << STOREOBJECTINFO_MAGIC_ID_VALUE << STOREOBJECTINFO_MAGIC_ID_STRING << STOREOBJECTINFO_VERSION
- << GetConfiguration().GetModTime()
- << aClientStoreMarker << theLastSyncTime << theNextSyncTime;
-
- //
- //
- //
- int64_t iCount = mLocations.size();
- anArchive.Add(iCount);
-
- for (int v = 0; v < iCount; v++)
- {
- ASSERT(mLocations[v]);
- mLocations[v]->Serialize(anArchive);
- }
-
- //
- //
- //
- iCount = mIDMapMounts.size();
- anArchive.Add(iCount);
-
- for (int v = 0; v < iCount; v++)
- anArchive.Add(mIDMapMounts[v]);
-
- //
- //
- //
- aFile.Close();
- ::syslog(LOG_INFO, "Saved store object info file '%s'", GetConfiguration().GetKeyValue("StoreObjectInfoFile").c_str());
- }
- catch (...)
- {
- ::syslog(LOG_WARNING, "Requested store object info file '%s' not accessible or could not be created", GetConfiguration().GetKeyValue("StoreObjectInfoFile").c_str());
- }
-}
-
-// --------------------------------------------------------------------------
-//
-// Function
-// Name: BackupDaemon::DeserializeStoreObjectInfo(int64_t & aClientStoreMarker, box_time_t & theLastSyncTime, box_time_t & theNextSyncTime)
-// Purpose: Deserializes remote directory and file information from a stream of bytes, using an Archive abstraction.
-//
-// Created: 2005/04/11
-//
-// --------------------------------------------------------------------------
-void BackupDaemon::DeserializeStoreObjectInfo(int64_t & aClientStoreMarker, box_time_t & theLastSyncTime, box_time_t & theNextSyncTime)
-{
- //
- //
- //
- DeleteAllLocations();
-
- //
- //
- //
- if(!GetConfiguration().KeyExists("StoreObjectInfoFile") || GetConfiguration().GetKeyValue("StoreObjectInfoFile").size() <=0)
- return;
-
- try
- {
- FileStream aFile(GetConfiguration().GetKeyValue("StoreObjectInfoFile").c_str(), O_RDONLY);
- IOStreamArchive anArchive(aFile, 0);
-
- //
- // see if the content has a chance to be what we think it is
- //
- int iMagicValue = 0;
- anArchive.Get(iMagicValue);
-
- if (iMagicValue != STOREOBJECTINFO_MAGIC_ID_VALUE)
- {
- ::syslog(LOG_WARNING, "Store object info file '%s' is not what you think it is: no harm done, will re-cache from store", GetConfiguration().GetKeyValue("StoreObjectInfoFile").c_str());
- return;
- }
-
- //
- // get a bit optimistic and read in a string identifier
- //
- std::string strMagicValue;
- anArchive.Get(strMagicValue);
-
- if (strMagicValue != STOREOBJECTINFO_MAGIC_ID_STRING)
- {
- ::syslog(LOG_WARNING, "Store object info file '%s' is not what you think it is: no harm done, will re-cache from store", GetConfiguration().GetKeyValue("StoreObjectInfoFile").c_str());
- return;
- }
-
- //
- // ok, check if we are not loading some future development version by mistake
- //
- int iVersion = 0;
- anArchive.Get(iVersion);
-
- if (iVersion != STOREOBJECTINFO_VERSION)
- {
- ::syslog(LOG_WARNING, "Store object info file '%s' version [%d] unsupported: no harm done, will re-cache from store", GetConfiguration().GetKeyValue("StoreObjectInfoFile").c_str(), iVersion);
- return;
- }
-
- //
- // check if this state file is even valid for the loaded bbackupd.conf file
- //
- box_time_t lastKnownConfigModTime;
- anArchive.Get(lastKnownConfigModTime);
-
- if (lastKnownConfigModTime != GetConfiguration().GetModTime())
- {
- ::syslog(LOG_WARNING, "Store object info file '%s' out of date: no harm done, will re-cache from store", GetConfiguration().GetKeyValue("StoreObjectInfoFile").c_str());
- return;
- }
-
- //
- // this is it, go at it
- //
- anArchive >> aClientStoreMarker >> theLastSyncTime >> theNextSyncTime;
-
- //
- //
- //
- int64_t iCount = 0;
- anArchive.Get(iCount);
-
- for (int v = 0; v < iCount; v++)
- {
- Location* pLocation = new Location;
- if (!pLocation)
- throw std::bad_alloc();
-
- pLocation->Deserialize(anArchive);
- mLocations.push_back(pLocation);
- }
-
- //
- //
- //
- iCount = 0;
- anArchive.Get(iCount);
-
- for (int v = 0; v < iCount; v++)
- {
- std::string strItem;
- anArchive.Get(strItem);
-
- mIDMapMounts.push_back(strItem);
- }
-
- //
- //
- //
- aFile.Close();
- ::syslog(LOG_INFO, "Loaded store object info file '%s', version [%04d]", GetConfiguration().GetKeyValue("StoreObjectInfoFile").c_str(), iVersion);
- }
- catch (...)
- {
- DeleteAllLocations();
-
- aClientStoreMarker = BackupClientContext::ClientStoreMarker_NotKnown;
- theLastSyncTime = 0;
- theNextSyncTime = 0;
-
- ::syslog(LOG_WARNING, "Requested store object info file '%s' does not exist, not accessible, or inconsistent: no harm done, will re-cache from store", GetConfiguration().GetKeyValue("StoreObjectInfoFile").c_str());
- }
-}
+
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: BackupDaemon::SerializeStoreObjectInfo(int64_t aClientStoreMarker, box_time_t theLastSyncTime, box_time_t theNextSyncTime)
+// Purpose: Serializes remote directory and file information into a stream of bytes, using an Archive abstraction.
+//
+// Created: 2005/04/11
+//
+// --------------------------------------------------------------------------
+
+static const int STOREOBJECTINFO_MAGIC_ID_VALUE = 0x7777525F;
+static const std::string STOREOBJECTINFO_MAGIC_ID_STRING = "BBACKUPD-STATE";
+static const int STOREOBJECTINFO_VERSION = 1;
+
+void BackupDaemon::SerializeStoreObjectInfo(int64_t aClientStoreMarker, box_time_t theLastSyncTime, box_time_t theNextSyncTime) const
+{
+ if(!GetConfiguration().KeyExists("StoreObjectInfoFile") || GetConfiguration().GetKeyValue("StoreObjectInfoFile").size() <= 0)
+ return;
+
+ try
+ {
+ FileStream aFile(GetConfiguration().GetKeyValue("StoreObjectInfoFile").c_str(), O_WRONLY | O_CREAT | O_TRUNC);
+ IOStreamArchive anArchive(aFile, 0);
+
+ anArchive << STOREOBJECTINFO_MAGIC_ID_VALUE << STOREOBJECTINFO_MAGIC_ID_STRING << STOREOBJECTINFO_VERSION
+ << GetConfiguration().GetModTime()
+ << aClientStoreMarker << theLastSyncTime << theNextSyncTime;
+
+ //
+ //
+ //
+ int64_t iCount = mLocations.size();
+ anArchive.Add(iCount);
+
+ for (int v = 0; v < iCount; v++)
+ {
+ ASSERT(mLocations[v]);
+ mLocations[v]->Serialize(anArchive);
+ }
+
+ //
+ //
+ //
+ iCount = mIDMapMounts.size();
+ anArchive.Add(iCount);
+
+ for (int v = 0; v < iCount; v++)
+ anArchive.Add(mIDMapMounts[v]);
+
+ //
+ //
+ //
+ aFile.Close();
+ ::syslog(LOG_INFO, "Saved store object info file '%s'", GetConfiguration().GetKeyValue("StoreObjectInfoFile").c_str());
+ }
+ catch (...)
+ {
+ ::syslog(LOG_WARNING, "Requested store object info file '%s' not accessible or could not be created", GetConfiguration().GetKeyValue("StoreObjectInfoFile").c_str());
+ }
+}
+
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: BackupDaemon::DeserializeStoreObjectInfo(int64_t & aClientStoreMarker, box_time_t & theLastSyncTime, box_time_t & theNextSyncTime)
+// Purpose: Deserializes remote directory and file information from a stream of bytes, using an Archive abstraction.
+//
+// Created: 2005/04/11
+//
+// --------------------------------------------------------------------------
+void BackupDaemon::DeserializeStoreObjectInfo(int64_t & aClientStoreMarker, box_time_t & theLastSyncTime, box_time_t & theNextSyncTime)
+{
+ //
+ //
+ //
+ DeleteAllLocations();
+
+ //
+ //
+ //
+ if(!GetConfiguration().KeyExists("StoreObjectInfoFile") || GetConfiguration().GetKeyValue("StoreObjectInfoFile").size() <=0)
+ return;
+
+ try
+ {
+ FileStream aFile(GetConfiguration().GetKeyValue("StoreObjectInfoFile").c_str(), O_RDONLY);
+ IOStreamArchive anArchive(aFile, 0);
+
+ //
+ // see if the content has a chance to be what we think it is
+ //
+ int iMagicValue = 0;
+ anArchive.Get(iMagicValue);
+
+ if (iMagicValue != STOREOBJECTINFO_MAGIC_ID_VALUE)
+ {
+ ::syslog(LOG_WARNING, "Store object info file '%s' is not what you think it is: no harm done, will re-cache from store", GetConfiguration().GetKeyValue("StoreObjectInfoFile").c_str());
+ return;
+ }
+
+ //
+ // get a bit optimistic and read in a string identifier
+ //
+ std::string strMagicValue;
+ anArchive.Get(strMagicValue);
+
+ if (strMagicValue != STOREOBJECTINFO_MAGIC_ID_STRING)
+ {
+ ::syslog(LOG_WARNING, "Store object info file '%s' is not what you think it is: no harm done, will re-cache from store", GetConfiguration().GetKeyValue("StoreObjectInfoFile").c_str());
+ return;
+ }
+
+ //
+ // ok, check if we are not loading some future development version by mistake
+ //
+ int iVersion = 0;
+ anArchive.Get(iVersion);
+
+ if (iVersion != STOREOBJECTINFO_VERSION)
+ {
+ ::syslog(LOG_WARNING, "Store object info file '%s' version [%d] unsupported: no harm done, will re-cache from store", GetConfiguration().GetKeyValue("StoreObjectInfoFile").c_str(), iVersion);
+ return;
+ }
+
+ //
+ // check if this state file is even valid for the loaded bbackupd.conf file
+ //
+ box_time_t lastKnownConfigModTime;
+ anArchive.Get(lastKnownConfigModTime);
+
+ if (lastKnownConfigModTime != GetConfiguration().GetModTime())
+ {
+ ::syslog(LOG_WARNING, "Store object info file '%s' out of date: no harm done, will re-cache from store", GetConfiguration().GetKeyValue("StoreObjectInfoFile").c_str());
+ return;
+ }
+
+ //
+ // this is it, go at it
+ //
+ anArchive >> aClientStoreMarker >> theLastSyncTime >> theNextSyncTime;
+
+ //
+ //
+ //
+ int64_t iCount = 0;
+ anArchive.Get(iCount);
+
+ for (int v = 0; v < iCount; v++)
+ {
+ Location* pLocation = new Location;
+ if (!pLocation)
+ throw std::bad_alloc();
+
+ pLocation->Deserialize(anArchive);
+ mLocations.push_back(pLocation);
+ }
+
+ //
+ //
+ //
+ iCount = 0;
+ anArchive.Get(iCount);
+
+ for (int v = 0; v < iCount; v++)
+ {
+ std::string strItem;
+ anArchive.Get(strItem);
+
+ mIDMapMounts.push_back(strItem);
+ }
+
+ //
+ //
+ //
+ aFile.Close();
+ ::syslog(LOG_INFO, "Loaded store object info file '%s', version [%04d]", GetConfiguration().GetKeyValue("StoreObjectInfoFile").c_str(), iVersion);
+ }
+ catch (...)
+ {
+ DeleteAllLocations();
+
+ aClientStoreMarker = BackupClientContext::ClientStoreMarker_NotKnown;
+ theLastSyncTime = 0;
+ theNextSyncTime = 0;
+
+ ::syslog(LOG_WARNING, "Requested store object info file '%s' does not exist, not accessible, or inconsistent: no harm done, will re-cache from store", GetConfiguration().GetKeyValue("StoreObjectInfoFile").c_str());
+ }
+}
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupDaemon.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupDaemon.h
===================================================================
--- box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupDaemon.h 2006-01-17 22:27:22 UTC (rev 320)
+++ box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupDaemon.h 2006-01-17 22:43:33 UTC (rev 321)
@@ -58,9 +58,9 @@
#include "Socket.h"
#include "SocketListen.h"
#include "SocketStream.h"
-
-#include "Archive.h"
+#include "Archive.h"
+
class BackupClientDirectoryRecord;
class BackupClientContext;
class Configuration;
@@ -80,11 +80,11 @@
{
public:
BackupDaemon();
- ~BackupDaemon();
-
+ ~BackupDaemon();
+
// methods below do partial (specialized) serialization of client state only
- void SerializeStoreObjectInfo(int64_t aClientStoreMarker, box_time_t theLastSyncTime, box_time_t theNextSyncTime) const;
- void DeserializeStoreObjectInfo(int64_t & aClientStoreMarker, box_time_t & theLastSyncTime, box_time_t & theNextSyncTime);
+ void SerializeStoreObjectInfo(int64_t aClientStoreMarker, box_time_t theLastSyncTime, box_time_t theNextSyncTime) const;
+ void DeserializeStoreObjectInfo(int64_t & aClientStoreMarker, box_time_t & theLastSyncTime, box_time_t & theNextSyncTime);
private:
BackupDaemon(const BackupDaemon &);
public:
@@ -160,10 +160,10 @@
{
public:
Location();
- ~Location();
-
- void Deserialize(Archive & rArchive);
- void Serialize(Archive & rArchive) const;
+ ~Location();
+
+ void Deserialize(Archive & rArchive);
+ void Serialize(Archive & rArchive) const;
private:
Location(const Location &); // copy not allowed
Location &operator=(const Location &);
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbackupd/BackupDaemon.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbackupd/bbackupd.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbackupobjdump/bbackupobjdump.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbackupquery/BackupQueries.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbackupquery/BackupQueries.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbackupquery/bbackupquery.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbstoreaccounts/bbstoreaccounts.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbstored/BBStoreDHousekeeping.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: box/gary/boxbackup-0.09-mod/bin/bbstored/BackupCommands.cpp
===================================================================
--- box/gary/boxbackup-0.09-mod/bin/bbstored/BackupCommands.cpp 2006-01-17 22:27:22 UTC (rev 320)
+++ box/gary/boxbackup-0.09-mod/bin/bbstored/BackupCommands.cpp 2006-01-17 22:43:33 UTC (rev 321)
@@ -898,20 +898,20 @@
));
}
-// --------------------------------------------------------------------------
-//
-// Function
-// Name: BackupProtocolServerGetIsAlive::DoCommand(BackupProtocolServer &, BackupContext &)
-// Purpose: Return the amount of disc space used
-// Created: 19/4/04
-//
-// --------------------------------------------------------------------------
-std::auto_ptr<ProtocolObject> BackupProtocolServerGetIsAlive::DoCommand(BackupProtocolServer &rProtocol, BackupContext &rContext)
-{
- CHECK_PHASE(Phase_Commands)
-
- //
- // NOOP
- //
- return std::auto_ptr<ProtocolObject>(new BackupProtocolServerIsAlive());
-}
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: BackupProtocolServerGetIsAlive::DoCommand(BackupProtocolServer &, BackupContext &)
+// Purpose: Return the amount of disc space used
+// Created: 19/4/04
+//
+// --------------------------------------------------------------------------
+std::auto_ptr<ProtocolObject> BackupProtocolServerGetIsAlive::DoCommand(BackupProtocolServer &rProtocol, BackupContext &rContext)
+{
+ CHECK_PHASE(Phase_Commands)
+
+ //
+ // NOOP
+ //
+ return std::auto_ptr<ProtocolObject>(new BackupProtocolServerIsAlive());
+}
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbstored/BackupCommands.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbstored/BackupConstants.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbstored/BackupContext.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbstored/BackupContext.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbstored/BackupStoreDaemon.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbstored/BackupStoreDaemon.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbstored/HousekeepStoreAccount.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbstored/HousekeepStoreAccount.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/bin/bbstored/bbstored.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/infrastructure/buildenv-testmain-template.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupClientCryptoKeys.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupClientCryptoKeys.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupClientFileAttributes.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupClientFileAttributes.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupClientMakeExcludeList.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupClientMakeExcludeList.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupClientRestore.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupClientRestore.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupDaemonConfigVerify.cpp
===================================================================
--- box/gary/boxbackup-0.09-mod/lib/backupclient/BackupDaemonConfigVerify.cpp 2006-01-17 22:27:22 UTC (rev 320)
+++ box/gary/boxbackup-0.09-mod/lib/backupclient/BackupDaemonConfigVerify.cpp 2006-01-17 22:43:33 UTC (rev 321)
@@ -123,8 +123,8 @@
{"ExtendedLogging", "no", ConfigTest_IsBool, 0}, // make value "yes" to enable in config file
{"CommandSocket", 0, 0, 0}, // not compulsory to have this
- {"StoreObjectInfoFile", 0, 0, 0}, // optional
- {"KeepAliveTime", 0, ConfigTest_IsInt, 0}, // optional
+ {"StoreObjectInfoFile", 0, 0, 0}, // optional
+ {"KeepAliveTime", 0, ConfigTest_IsInt, 0}, // optional
{"NotifyScript", 0, 0, 0}, // optional script to run when backup needs attention, eg store full
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupDaemonConfigVerify.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupDaemonConfigVerify.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreConstants.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreDirectory.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreDirectory.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreException.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFile.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFile.h
===================================================================
--- box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFile.h 2006-01-17 22:27:22 UTC (rev 320)
+++ box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFile.h 2006-01-17 22:43:33 UTC (rev 321)
@@ -180,16 +180,16 @@
free(a);
}
- // --------------------------------------------------------------------------
- //
- // Function
- // Name: BackupStoreFile::SuspendFileDiff()
- // Purpose: Notifies BackupStoreFile object that a diff operation should be
- // terminated ASAP. Usually called from an external timer.
- //
- // Created: 12/1/04
- //
- // --------------------------------------------------------------------------
+ // --------------------------------------------------------------------------
+ //
+ // Function
+ // Name: BackupStoreFile::SuspendFileDiff()
+ // Purpose: Notifies BackupStoreFile object that a diff operation should be
+ // terminated ASAP. Usually called from an external timer.
+ //
+ // Created: 12/1/04
+ //
+ // --------------------------------------------------------------------------
static void SuspendFileDiff();
// Building blocks
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFile.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileCmbDiff.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileCmbIdx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileCombine.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileCryptVar.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileCryptVar.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileDiff.cpp
===================================================================
--- box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileDiff.cpp 2006-01-17 22:27:22 UTC (rev 320)
+++ box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileDiff.cpp 2006-01-17 22:43:33 UTC (rev 321)
@@ -58,7 +58,7 @@
#include "BackupStoreException.h"
#include "BackupStoreFileEncodeStream.h"
#include "BackupStoreConstants.h"
-#include "FileStream.h"
+#include "FileStream.h"
#include "RollingChecksum.h"
#include "MD5Digest.h"
#include "CommonException.h"
@@ -80,28 +80,28 @@
static void SetupHashTable(BlocksAvailableEntry *pIndex, int64_t NumBlocks, int32_t BlockSize, BlocksAvailableEntry **pHashTable);
static bool SecondStageMatch(BlocksAvailableEntry *pFirstInHashList, uint16_t Hash, uint8_t *pBeginnings, uint8_t *pEndings, int Offset, int32_t BlockSize, int64_t FileBlockNumber, BlocksAvailableEntry *pIndex, std::map<int64_t, int64_t> &rFoundBlocks);
static void GenerateRecipe(BackupStoreFileEncodeStream::Recipe &rRecipe, BlocksAvailableEntry *pIndex, int64_t NumBlocks, std::map<int64_t, int64_t> &rFoundBlocks, int64_t SizeOfInputFile);
-
+
// control whether a currently active diff should be terminated ASAP
static bool sDiffTimedOut = false;
-
-// --------------------------------------------------------------------------
-//
-// Function
-// Name: BackupStoreFile::SuspendFileDiff()
-// Purpose: Notifies BackupStoreFile object that a diff operation should be
-// terminated ASAP. Usually called from an external timer.
-//
-// Created: 12/1/04
-//
-// --------------------------------------------------------------------------
-void BackupStoreFile::SuspendFileDiff()
-{
- sDiffTimedOut = true;
-}
// --------------------------------------------------------------------------
//
// Function
+// Name: BackupStoreFile::SuspendFileDiff()
+// Purpose: Notifies BackupStoreFile object that a diff operation should be
+// terminated ASAP. Usually called from an external timer.
+//
+// Created: 12/1/04
+//
+// --------------------------------------------------------------------------
+void BackupStoreFile::SuspendFileDiff()
+{
+ sDiffTimedOut = true;
+}
+
+// --------------------------------------------------------------------------
+//
+// Function
// Name: BackupStoreFile::MoveStreamPositionToBlockIndex(IOStream &)
// Purpose: Move the file pointer in this stream to just before the block index.
// Assumes that the stream is at the beginning, seekable, and
@@ -497,9 +497,9 @@
// --------------------------------------------------------------------------
static void SearchForMatchingBlocks(IOStream &rFile, std::map<int64_t, int64_t> &rFoundBlocks,
BlocksAvailableEntry *pIndex, int64_t NumBlocks, int32_t Sizes[BACKUP_FILE_DIFF_MAX_BLOCK_SIZES])
-{
- // reset state in case we got timing/call-order mess-up somewhere else
- sDiffTimedOut = false;
+{
+ // reset state in case we got timing/call-order mess-up somewhere else
+ sDiffTimedOut = false;
// Allocate the hash lookup table
BlocksAvailableEntry **phashTable = (BlocksAvailableEntry **)::malloc(sizeof(BlocksAvailableEntry *) * (64*1024));
@@ -622,7 +622,7 @@
if(static_cast<int64_t>(rFoundBlocks.size()) > (NumBlocks * BACKUP_FILE_DIFF_MAX_BLOCK_FIND_MULTIPLE)
|| sDiffTimedOut)
{
- abortSearch = true;
+ abortSearch = true;
break;
}
}
@@ -949,4 +949,4 @@
TRACE0("======== ========= ========\n");
}
#endif
-}
+}
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileDiff.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileEncodeStream.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileEncodeStream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileRevDiff.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFileWire.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFilename.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFilename.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFilenameClear.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreFilenameClear.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreObjectDump.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupclient/BackupStoreObjectMagic.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreAccountDatabase.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreAccountDatabase.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreAccounts.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreAccounts.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreCheck.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreCheck.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreCheck2.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreCheckData.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreConfigVerify.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreConfigVerify.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreInfo.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupstore/BackupStoreInfo.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupstore/StoreStructure.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/backupstore/StoreStructure.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: box/gary/boxbackup-0.09-mod/lib/common/Archive.h
===================================================================
--- box/gary/boxbackup-0.09-mod/lib/common/Archive.h 2006-01-17 22:27:22 UTC (rev 320)
+++ box/gary/boxbackup-0.09-mod/lib/common/Archive.h 2006-01-17 22:43:33 UTC (rev 321)
@@ -1,243 +1,243 @@
-// distribution boxbackup-0.09
-//
-//
-// Copyright (c) 2003, 2004
-// Ben Summers. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// 3. All use of this software and associated advertising materials must
-// display the following acknowledgement:
-// This product includes software developed by Ben Summers.
-// 4. The names of the Authors may not be used to endorse or promote
-// products derived from this software without specific prior written
-// permission.
-//
-// [Where legally impermissible the Authors do not disclaim liability for
-// direct physical injury or death caused solely by defects in the software
-// unless it is modified by a third party.]
-//
-// THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
-// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
-// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-//
-//
-// --------------------------------------------------------------------------
-//
-// File
-// Name: Archive.h
-// Purpose: Backup daemon state archive
-// Created: 2005/04/11
-//
-// --------------------------------------------------------------------------
-
-#ifndef ARCHIVE__H
-#define ARCHIVE__H
-
-#include <vector>
-#include <string>
-#include <memory>
-
-#include "IOStream.h"
-#include "Guards.h"
-
-#define ARCHIVE_GET_SIZE(hdr) (( ((uint8_t)((hdr)[0])) | ( ((uint8_t)((hdr)[1])) << 8)) >> 2)
-
-#define ARCHIVE_MAGIC_VALUE_RECURSE 0x4449525F
-#define ARCHIVE_MAGIC_VALUE_NOOP 0x5449525F
-
-class Archive
-{
-public:
- Archive()
- {
- }
- virtual ~Archive()
- {
- }
- //
- // primitive insertion operations
- //
- virtual void Add(bool bItem) = 0;
- virtual void Add(int iItem) = 0;
- virtual void Add(int64_t iItem) = 0;
- virtual void Add(uint64_t iItem) = 0;
- virtual void Add(uint8_t iItem) = 0;
- virtual void Add(const std::string & strItem) = 0;
- //
- // chaining support
- //
- Archive & operator<<(bool bItem) { Add(bItem); return *this; }
- Archive & operator<<(int iItem) { Add(iItem); return *this; }
- Archive & operator<<(int64_t iItem) { Add(iItem); return *this; }
- Archive & operator<<(uint64_t iItem) { Add(iItem); return *this; }
- Archive & operator<<(uint8_t iItem) { Add(iItem); return *this; }
- Archive & operator<<(const std::string & strItem) { Add(strItem); return *this; }
- //
- // primitive extraction oprations
- //
- virtual void Get(bool & bItem) = 0;
- virtual void Get(int & iItem) = 0;
- virtual void Get(int64_t & iItem) = 0;
- virtual void Get(uint64_t & iItem) = 0;
- virtual void Get(uint8_t & iItem) = 0;
- virtual void Get(std::string & strItem) = 0;
- //
- // chaining support
- //
- Archive & operator>>(bool & bItem) { Get(bItem); return *this; }
- Archive & operator>>(int & iItem) { Get(iItem); return *this; }
- Archive & operator>>(int64_t & iItem) { Get(iItem); return *this; }
- Archive & operator>>(uint64_t & iItem) { Get(iItem); return *this; }
- Archive & operator>>(uint8_t & iItem) { Get(iItem); return *this; }
- Archive & operator>>(std::string & strItem) { Get(strItem); return *this; }
-private:
- Archive(const Archive &);
- Archive & operator=(const Archive &);
-};
-
-class IOStreamArchive : public Archive
-{
-public:
- IOStreamArchive(IOStream & mStream, int Timeout) : mStream(mStream)
- {
- mTimeout = Timeout;
- }
- virtual ~IOStreamArchive()
- {
- }
- //
- //
- //
- virtual void Add(bool bItem)
- {
- Add((int) bItem);
- }
- virtual void Add(int iItem)
- {
- int32_t privItem = htonl(iItem);
- mStream.Write(&privItem, sizeof(privItem));
- }
- virtual void Add(int64_t iItem)
- {
- int64_t privItem = hton64(iItem);
- mStream.Write(&privItem, sizeof(privItem));
- }
- virtual void Add(uint64_t iItem)
- {
- uint64_t privItem = hton64(iItem);
- mStream.Write(&privItem, sizeof(privItem));
- }
- virtual void Add(uint8_t iItem)
- {
- int privItem = iItem;
- Add(privItem);
- }
- virtual void Add(const std::string & strItem)
- {
- int iSize = strItem.size();
- Add(iSize);
- mStream.Write(strItem.c_str(), iSize);
- }
- //
- //
- //
- virtual void Get(bool & bItem)
- {
- int privItem;
- Get(privItem);
-
- if (privItem)
- bItem = true;
- else
- bItem = false;
- }
- virtual void Get(int & iItem)
- {
- int32_t privItem;
- if(!mStream.ReadFullBuffer(&privItem, sizeof(privItem), 0 /* not interested in bytes read if this fails */))
- {
- THROW_EXCEPTION(CommonException, StreamableMemBlockIncompleteRead)
- }
- iItem = ntohl(privItem);
- }
- virtual void Get(int64_t & iItem)
- {
- int64_t privItem;
- if(!mStream.ReadFullBuffer(&privItem, sizeof(privItem), 0 /* not interested in bytes read if this fails */))
- {
- THROW_EXCEPTION(CommonException, StreamableMemBlockIncompleteRead)
- }
- iItem = ntoh64(privItem);
- }
- virtual void Get(uint64_t & iItem)
- {
- uint64_t privItem;
- if(!mStream.ReadFullBuffer(&privItem, sizeof(privItem), 0 /* not interested in bytes read if this fails */))
- {
- THROW_EXCEPTION(CommonException, StreamableMemBlockIncompleteRead)
- }
- iItem = ntoh64(privItem);
- }
- virtual void Get(uint8_t & iItem)
- {
- int privItem;
- Get(privItem);
- iItem = privItem;
- }
- virtual void Get(std::string & strItem)
- {
- int iSize;
- Get(iSize);
-
- // Assume most strings are relatively small
- char buf[256];
- if(iSize < (int) sizeof(buf))
- {
- // Fetch rest of pPayload, relying on the Protocol to error on stupidly large sizes for us
- if(!mStream.ReadFullBuffer(buf, iSize, 0 /* not interested in bytes read if this fails */, mTimeout))
- {
- THROW_EXCEPTION(CommonException, StreamableMemBlockIncompleteRead)
- }
- // assign to this string, storing the header and the extra pPayload
- strItem.assign(buf, iSize);
- }
- else
- {
- // Block of memory to hold it
- MemoryBlockGuard<char*> dataB(iSize);
- char *pPayload = dataB;
-
- // Fetch rest of pPayload, relying on the Protocol to error on stupidly large sizes for us
- if(!mStream.ReadFullBuffer(pPayload, iSize, 0 /* not interested in bytes read if this fails */, mTimeout))
- {
- THROW_EXCEPTION(CommonException, StreamableMemBlockIncompleteRead)
- }
- // assign to this string, storing the header and the extra pPayload
- strItem.assign(pPayload, iSize);
- }
- }
-protected:
- IOStream & mStream;
- int mTimeout;
-private:
- IOStreamArchive(const IOStreamArchive &);
- IOStreamArchive & operator=(const IOStreamArchive &);
-};
-
-#endif // ARCHIVE__H
+// distribution boxbackup-0.09
+//
+//
+// Copyright (c) 2003, 2004
+// Ben Summers. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. All use of this software and associated advertising materials must
+// display the following acknowledgement:
+// This product includes software developed by Ben Summers.
+// 4. The names of the Authors may not be used to endorse or promote
+// products derived from this software without specific prior written
+// permission.
+//
+// [Where legally impermissible the Authors do not disclaim liability for
+// direct physical injury or death caused solely by defects in the software
+// unless it is modified by a third party.]
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+//
+//
+//
+// --------------------------------------------------------------------------
+//
+// File
+// Name: Archive.h
+// Purpose: Backup daemon state archive
+// Created: 2005/04/11
+//
+// --------------------------------------------------------------------------
+
+#ifndef ARCHIVE__H
+#define ARCHIVE__H
+
+#include <vector>
+#include <string>
+#include <memory>
+
+#include "IOStream.h"
+#include "Guards.h"
+
+#define ARCHIVE_GET_SIZE(hdr) (( ((uint8_t)((hdr)[0])) | ( ((uint8_t)((hdr)[1])) << 8)) >> 2)
+
+#define ARCHIVE_MAGIC_VALUE_RECURSE 0x4449525F
+#define ARCHIVE_MAGIC_VALUE_NOOP 0x5449525F
+
+class Archive
+{
+public:
+ Archive()
+ {
+ }
+ virtual ~Archive()
+ {
+ }
+ //
+ // primitive insertion operations
+ //
+ virtual void Add(bool bItem) = 0;
+ virtual void Add(int iItem) = 0;
+ virtual void Add(int64_t iItem) = 0;
+ virtual void Add(uint64_t iItem) = 0;
+ virtual void Add(uint8_t iItem) = 0;
+ virtual void Add(const std::string & strItem) = 0;
+ //
+ // chaining support
+ //
+ Archive & operator<<(bool bItem) { Add(bItem); return *this; }
+ Archive & operator<<(int iItem) { Add(iItem); return *this; }
+ Archive & operator<<(int64_t iItem) { Add(iItem); return *this; }
+ Archive & operator<<(uint64_t iItem) { Add(iItem); return *this; }
+ Archive & operator<<(uint8_t iItem) { Add(iItem); return *this; }
+ Archive & operator<<(const std::string & strItem) { Add(strItem); return *this; }
+ //
+ // primitive extraction oprations
+ //
+ virtual void Get(bool & bItem) = 0;
+ virtual void Get(int & iItem) = 0;
+ virtual void Get(int64_t & iItem) = 0;
+ virtual void Get(uint64_t & iItem) = 0;
+ virtual void Get(uint8_t & iItem) = 0;
+ virtual void Get(std::string & strItem) = 0;
+ //
+ // chaining support
+ //
+ Archive & operator>>(bool & bItem) { Get(bItem); return *this; }
+ Archive & operator>>(int & iItem) { Get(iItem); return *this; }
+ Archive & operator>>(int64_t & iItem) { Get(iItem); return *this; }
+ Archive & operator>>(uint64_t & iItem) { Get(iItem); return *this; }
+ Archive & operator>>(uint8_t & iItem) { Get(iItem); return *this; }
+ Archive & operator>>(std::string & strItem) { Get(strItem); return *this; }
+private:
+ Archive(const Archive &);
+ Archive & operator=(const Archive &);
+};
+
+class IOStreamArchive : public Archive
+{
+public:
+ IOStreamArchive(IOStream & mStream, int Timeout) : mStream(mStream)
+ {
+ mTimeout = Timeout;
+ }
+ virtual ~IOStreamArchive()
+ {
+ }
+ //
+ //
+ //
+ virtual void Add(bool bItem)
+ {
+ Add((int) bItem);
+ }
+ virtual void Add(int iItem)
+ {
+ int32_t privItem = htonl(iItem);
+ mStream.Write(&privItem, sizeof(privItem));
+ }
+ virtual void Add(int64_t iItem)
+ {
+ int64_t privItem = hton64(iItem);
+ mStream.Write(&privItem, sizeof(privItem));
+ }
+ virtual void Add(uint64_t iItem)
+ {
+ uint64_t privItem = hton64(iItem);
+ mStream.Write(&privItem, sizeof(privItem));
+ }
+ virtual void Add(uint8_t iItem)
+ {
+ int privItem = iItem;
+ Add(privItem);
+ }
+ virtual void Add(const std::string & strItem)
+ {
+ int iSize = strItem.size();
+ Add(iSize);
+ mStream.Write(strItem.c_str(), iSize);
+ }
+ //
+ //
+ //
+ virtual void Get(bool & bItem)
+ {
+ int privItem;
+ Get(privItem);
+
+ if (privItem)
+ bItem = true;
+ else
+ bItem = false;
+ }
+ virtual void Get(int & iItem)
+ {
+ int32_t privItem;
+ if(!mStream.ReadFullBuffer(&privItem, sizeof(privItem), 0 /* not interested in bytes read if this fails */))
+ {
+ THROW_EXCEPTION(CommonException, StreamableMemBlockIncompleteRead)
+ }
+ iItem = ntohl(privItem);
+ }
+ virtual void Get(int64_t & iItem)
+ {
+ int64_t privItem;
+ if(!mStream.ReadFullBuffer(&privItem, sizeof(privItem), 0 /* not interested in bytes read if this fails */))
+ {
+ THROW_EXCEPTION(CommonException, StreamableMemBlockIncompleteRead)
+ }
+ iItem = ntoh64(privItem);
+ }
+ virtual void Get(uint64_t & iItem)
+ {
+ uint64_t privItem;
+ if(!mStream.ReadFullBuffer(&privItem, sizeof(privItem), 0 /* not interested in bytes read if this fails */))
+ {
+ THROW_EXCEPTION(CommonException, StreamableMemBlockIncompleteRead)
+ }
+ iItem = ntoh64(privItem);
+ }
+ virtual void Get(uint8_t & iItem)
+ {
+ int privItem;
+ Get(privItem);
+ iItem = privItem;
+ }
+ virtual void Get(std::string & strItem)
+ {
+ int iSize;
+ Get(iSize);
+
+ // Assume most strings are relatively small
+ char buf[256];
+ if(iSize < (int) sizeof(buf))
+ {
+ // Fetch rest of pPayload, relying on the Protocol to error on stupidly large sizes for us
+ if(!mStream.ReadFullBuffer(buf, iSize, 0 /* not interested in bytes read if this fails */, mTimeout))
+ {
+ THROW_EXCEPTION(CommonException, StreamableMemBlockIncompleteRead)
+ }
+ // assign to this string, storing the header and the extra pPayload
+ strItem.assign(buf, iSize);
+ }
+ else
+ {
+ // Block of memory to hold it
+ MemoryBlockGuard<char*> dataB(iSize);
+ char *pPayload = dataB;
+
+ // Fetch rest of pPayload, relying on the Protocol to error on stupidly large sizes for us
+ if(!mStream.ReadFullBuffer(pPayload, iSize, 0 /* not interested in bytes read if this fails */, mTimeout))
+ {
+ THROW_EXCEPTION(CommonException, StreamableMemBlockIncompleteRead)
+ }
+ // assign to this string, storing the header and the extra pPayload
+ strItem.assign(pPayload, iSize);
+ }
+ }
+protected:
+ IOStream & mStream;
+ int mTimeout;
+private:
+ IOStreamArchive(const IOStreamArchive &);
+ IOStreamArchive & operator=(const IOStreamArchive &);
+};
+
+#endif // ARCHIVE__H
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/Archive.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/BannerText.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/BeginStructPackForWire.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/Box.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/BoxException.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/BoxException.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/BoxPlatform.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/BoxPortsAndFiles.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/BoxTime.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/BoxTime.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/BoxTimeToText.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/BoxTimeToText.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/BoxTimeToUnix.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/CollectInBufferStream.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/CollectInBufferStream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/CommonException.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: box/gary/boxbackup-0.09-mod/lib/common/Configuration.cpp
===================================================================
--- box/gary/boxbackup-0.09-mod/lib/common/Configuration.cpp 2006-01-17 22:27:22 UTC (rev 320)
+++ box/gary/boxbackup-0.09-mod/lib/common/Configuration.cpp 2006-01-17 22:43:33 UTC (rev 321)
@@ -57,9 +57,9 @@
#include "FdGetLine.h"
#include "MemLeakFindOn.h"
-
-#include "FileModificationTime.h"
+#include "FileModificationTime.h"
+
// utility whitespace function
inline bool iw(int c)
{
@@ -70,18 +70,18 @@
static const char *sValueBooleanStrings[] = {"yes", "true", "no", "false", 0};
static const bool sValueBooleanValue[] = {true, true, false, false};
-// --------------------------------------------------------------------------
-//
-// Function
-// Name: Configuration::Configuration(const std::string &, box_time_t)
-// Purpose: Constructor
-// Created: 2003/07/23
-//
-// --------------------------------------------------------------------------
-Configuration::Configuration(const std::string &rName, box_time_t configModTime)
- : mName(rName), mConfigModTime(configModTime)
-{
-}
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: Configuration::Configuration(const std::string &, box_time_t)
+// Purpose: Constructor
+// Created: 2003/07/23
+//
+// --------------------------------------------------------------------------
+Configuration::Configuration(const std::string &rName, box_time_t configModTime)
+ : mName(rName), mConfigModTime(configModTime)
+{
+}
// --------------------------------------------------------------------------
//
@@ -94,7 +94,7 @@
Configuration::Configuration(const Configuration &rToCopy)
: mName(rToCopy.mName),
mSubConfigurations(rToCopy.mSubConfigurations),
- mKeys(rToCopy.mKeys),
+ mKeys(rToCopy.mKeys),
mConfigModTime(rToCopy.mConfigModTime)
{
}
@@ -132,13 +132,13 @@
// Just to make sure
rErrorMsg.erase();
-
- // Save modification time to be able to distinguish across configuration sets
- struct stat st;
- if(::stat(Filename, &st) != 0)
- {
- THROW_EXCEPTION(CommonException, OSFileError)
- }
+
+ // Save modification time to be able to distinguish across configuration sets
+ struct stat st;
+ if(::stat(Filename, &st) != 0)
+ {
+ THROW_EXCEPTION(CommonException, OSFileError)
+ }
// Open the file
FileHandleGuard<O_RDONLY> file(Filename);
@@ -222,7 +222,7 @@
if(startBlockExpected)
{
// New config object
- Configuration config(blockName, rConfig.mConfigModTime);
+ Configuration config(blockName, rConfig.mConfigModTime);
// Continue processing into this block
if(!LoadInto(config, rGetLine, rErrorMsg, false))
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/Configuration.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: box/gary/boxbackup-0.09-mod/lib/common/Configuration.h
===================================================================
--- box/gary/boxbackup-0.09-mod/lib/common/Configuration.h 2006-01-17 22:27:22 UTC (rev 320)
+++ box/gary/boxbackup-0.09-mod/lib/common/Configuration.h 2006-01-17 22:43:33 UTC (rev 321)
@@ -54,9 +54,9 @@
#include <vector>
#include <string>
#include <memory>
-
-#include "BoxTime.h"
+#include "BoxTime.h"
+
// For defining tests
enum
{
@@ -103,8 +103,8 @@
public:
Configuration(const Configuration &rToCopy);
~Configuration();
-
- box_time_t GetModTime() const { return mConfigModTime; }
+
+ box_time_t GetModTime() const { return mConfigModTime; }
enum
{
@@ -130,7 +130,7 @@
typedef std::list<std::pair<std::string, Configuration> > SubConfigListType;
SubConfigListType mSubConfigurations;
// Order of keys, not preserved
- std::map<std::string, std::string> mKeys;
+ std::map<std::string, std::string> mKeys;
protected:
box_time_t mConfigModTime;
private:
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/Configuration.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/Conversion.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/ConversionString.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/DebugAssertFailed.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/DebugMemLeakFinder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/DebugPrintf.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/EndStructPackForWire.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/EventWatchFilesystemObject.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/EventWatchFilesystemObject.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: box/gary/boxbackup-0.09-mod/lib/common/ExcludeList.cpp
===================================================================
--- box/gary/boxbackup-0.09-mod/lib/common/ExcludeList.cpp 2006-01-17 22:27:22 UTC (rev 320)
+++ box/gary/boxbackup-0.09-mod/lib/common/ExcludeList.cpp 2006-01-17 22:43:33 UTC (rev 321)
@@ -168,8 +168,8 @@
}
// Store in list of regular expressions
- mRegex.push_back(pregex);
- // Store in list of regular expression string for Serialize
+ mRegex.push_back(pregex);
+ // Store in list of regular expression string for Serialize
mRegexStr.push_back(i->c_str());
}
catch(...)
@@ -253,170 +253,170 @@
// Store the pointer
mpAlwaysInclude = pAlwaysInclude;
}
-
-// --------------------------------------------------------------------------
-//
-// Function
-// Name: ExcludeList::Deserialize(Archive & rArchive)
-// Purpose: Deserializes this object instance from a stream of bytes, using an Archive abstraction.
-//
-// Created: 2005/04/11
-//
-// --------------------------------------------------------------------------
-void ExcludeList::Deserialize(Archive & rArchive)
-{
- //
- //
- //
- mDefinite.clear();
-
-#ifndef PLATFORM_REGEX_NOT_SUPPORTED
- // free regex memory
- while(mRegex.size() > 0)
- {
- regex_t *pregex = mRegex.back();
- mRegex.pop_back();
- // Free regex storage, and the structure itself
- ::regfree(pregex);
- delete pregex;
- }
-
- mRegexStr.clear();
-#endif
-
- // Clean up exceptions list
- if(mpAlwaysInclude != 0)
- {
- delete mpAlwaysInclude;
- mpAlwaysInclude = 0;
- }
-
- //
- //
- //
- int64_t iCount = 0;
- rArchive.Get(iCount);
-
- if (iCount > 0)
- {
- for (int v = 0; v < iCount; v++)
- {
- std::string strItem;
- rArchive.Get(strItem);
-
- /**** LOAD ****/ mDefinite.insert(strItem);
- }
- }
-
- //
- //
- //
-#ifndef PLATFORM_REGEX_NOT_SUPPORTED
- rArchive.Get(iCount);
-
- if (iCount > 0)
- {
- for (int v = 0; v < iCount; v++)
- {
- std::string strItem;
- rArchive.Get(strItem);
-
- // Allocate memory
- regex_t* pregex = new regex_t;
-
- try
- {
- // Compile
- if(::regcomp(pregex, strItem.c_str(), REG_EXTENDED | REG_NOSUB) != 0)
- {
- THROW_EXCEPTION(CommonException, BadRegularExpression)
- }
-
- // Store in list of regular expressions
- /**** LOAD ****/ mRegex.push_back(pregex);
- // Store in list of regular expression string for Serialize
- /**** LOAD ****/ mRegexStr.push_back(strItem);
- }
- catch(...)
- {
- delete pregex;
- throw;
- }
- }
- }
-#endif // PLATFORM_REGEX_NOT_SUPPORTED
-
- //
- //
- //
- int64_t aMagicMarker = 0;
- rArchive.Get(aMagicMarker);
-
- if (aMagicMarker == ARCHIVE_MAGIC_VALUE_NOOP)
- {
- // NOOP
- }
- else if (aMagicMarker == ARCHIVE_MAGIC_VALUE_RECURSE)
- {
- /**** LOAD ****/ mpAlwaysInclude = new ExcludeList;
- if (!mpAlwaysInclude)
- throw std::bad_alloc();
-
- mpAlwaysInclude->Deserialize(rArchive);
- }
- else
- {
- // there is something going on here
- THROW_EXCEPTION(CommonException, Internal)
- }
-}
-
-// --------------------------------------------------------------------------
-//
-// Function
-// Name: ExcludeList::Serialize(Archive & rArchive)
-// Purpose: Serializes this object instance into a stream of bytes, using an Archive abstraction.
-//
-// Created: 2005/04/11
-//
-// --------------------------------------------------------------------------
-void ExcludeList::Serialize(Archive & rArchive) const
-{
- //
- //
- //
- int64_t iCount = mDefinite.size();
- rArchive.Add(iCount);
-
- for (std::set<std::string>::const_iterator i = mDefinite.begin(); i != mDefinite.end(); i++)
- rArchive.Add(*i);
-
- //
- //
- //
-#ifndef PLATFORM_REGEX_NOT_SUPPORTED
- ASSERT(mRegex.size() == mRegexStr.size()); // don't even try to save compiled regular expressions - use string copies
-
- iCount = mRegexStr.size();
- rArchive.Add(iCount);
-
- for (std::vector<std::string>::const_iterator i = mRegexStr.begin(); i != mRegexStr.end(); i++)
- rArchive.Add(*i);
-#endif // PLATFORM_REGEX_NOT_SUPPORTED
-
- //
- //
- //
- if (!mpAlwaysInclude)
- {
- int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_NOOP;
- rArchive.Add(aMagicMarker);
- }
- else
- {
- int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_RECURSE; // be explicit about whether recursion follows
- rArchive.Add(aMagicMarker);
-
- mpAlwaysInclude->Serialize(rArchive);
- }
-}
+
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: ExcludeList::Deserialize(Archive & rArchive)
+// Purpose: Deserializes this object instance from a stream of bytes, using an Archive abstraction.
+//
+// Created: 2005/04/11
+//
+// --------------------------------------------------------------------------
+void ExcludeList::Deserialize(Archive & rArchive)
+{
+ //
+ //
+ //
+ mDefinite.clear();
+
+#ifndef PLATFORM_REGEX_NOT_SUPPORTED
+ // free regex memory
+ while(mRegex.size() > 0)
+ {
+ regex_t *pregex = mRegex.back();
+ mRegex.pop_back();
+ // Free regex storage, and the structure itself
+ ::regfree(pregex);
+ delete pregex;
+ }
+
+ mRegexStr.clear();
+#endif
+
+ // Clean up exceptions list
+ if(mpAlwaysInclude != 0)
+ {
+ delete mpAlwaysInclude;
+ mpAlwaysInclude = 0;
+ }
+
+ //
+ //
+ //
+ int64_t iCount = 0;
+ rArchive.Get(iCount);
+
+ if (iCount > 0)
+ {
+ for (int v = 0; v < iCount; v++)
+ {
+ std::string strItem;
+ rArchive.Get(strItem);
+
+ /**** LOAD ****/ mDefinite.insert(strItem);
+ }
+ }
+
+ //
+ //
+ //
+#ifndef PLATFORM_REGEX_NOT_SUPPORTED
+ rArchive.Get(iCount);
+
+ if (iCount > 0)
+ {
+ for (int v = 0; v < iCount; v++)
+ {
+ std::string strItem;
+ rArchive.Get(strItem);
+
+ // Allocate memory
+ regex_t* pregex = new regex_t;
+
+ try
+ {
+ // Compile
+ if(::regcomp(pregex, strItem.c_str(), REG_EXTENDED | REG_NOSUB) != 0)
+ {
+ THROW_EXCEPTION(CommonException, BadRegularExpression)
+ }
+
+ // Store in list of regular expressions
+ /**** LOAD ****/ mRegex.push_back(pregex);
+ // Store in list of regular expression string for Serialize
+ /**** LOAD ****/ mRegexStr.push_back(strItem);
+ }
+ catch(...)
+ {
+ delete pregex;
+ throw;
+ }
+ }
+ }
+#endif // PLATFORM_REGEX_NOT_SUPPORTED
+
+ //
+ //
+ //
+ int64_t aMagicMarker = 0;
+ rArchive.Get(aMagicMarker);
+
+ if (aMagicMarker == ARCHIVE_MAGIC_VALUE_NOOP)
+ {
+ // NOOP
+ }
+ else if (aMagicMarker == ARCHIVE_MAGIC_VALUE_RECURSE)
+ {
+ /**** LOAD ****/ mpAlwaysInclude = new ExcludeList;
+ if (!mpAlwaysInclude)
+ throw std::bad_alloc();
+
+ mpAlwaysInclude->Deserialize(rArchive);
+ }
+ else
+ {
+ // there is something going on here
+ THROW_EXCEPTION(CommonException, Internal)
+ }
+}
+
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: ExcludeList::Serialize(Archive & rArchive)
+// Purpose: Serializes this object instance into a stream of bytes, using an Archive abstraction.
+//
+// Created: 2005/04/11
+//
+// --------------------------------------------------------------------------
+void ExcludeList::Serialize(Archive & rArchive) const
+{
+ //
+ //
+ //
+ int64_t iCount = mDefinite.size();
+ rArchive.Add(iCount);
+
+ for (std::set<std::string>::const_iterator i = mDefinite.begin(); i != mDefinite.end(); i++)
+ rArchive.Add(*i);
+
+ //
+ //
+ //
+#ifndef PLATFORM_REGEX_NOT_SUPPORTED
+ ASSERT(mRegex.size() == mRegexStr.size()); // don't even try to save compiled regular expressions - use string copies
+
+ iCount = mRegexStr.size();
+ rArchive.Add(iCount);
+
+ for (std::vector<std::string>::const_iterator i = mRegexStr.begin(); i != mRegexStr.end(); i++)
+ rArchive.Add(*i);
+#endif // PLATFORM_REGEX_NOT_SUPPORTED
+
+ //
+ //
+ //
+ if (!mpAlwaysInclude)
+ {
+ int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_NOOP;
+ rArchive.Add(aMagicMarker);
+ }
+ else
+ {
+ int64_t aMagicMarker = ARCHIVE_MAGIC_VALUE_RECURSE; // be explicit about whether recursion follows
+ rArchive.Add(aMagicMarker);
+
+ mpAlwaysInclude->Serialize(rArchive);
+ }
+}
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/ExcludeList.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: box/gary/boxbackup-0.09-mod/lib/common/ExcludeList.h
===================================================================
--- box/gary/boxbackup-0.09-mod/lib/common/ExcludeList.h 2006-01-17 22:27:22 UTC (rev 320)
+++ box/gary/boxbackup-0.09-mod/lib/common/ExcludeList.h 2006-01-17 22:43:33 UTC (rev 321)
@@ -57,9 +57,9 @@
#ifndef EXCLUDELIST_IMPLEMENTATION_REGEX_T_DEFINED
typedef int regex_t;
#endif
-
-#include "Archive.h"
+#include "Archive.h"
+
// --------------------------------------------------------------------------
//
// Class
@@ -73,10 +73,10 @@
public:
ExcludeList();
~ExcludeList();
-
- void Deserialize(Archive & rArchive);
- void Serialize(Archive & rArchive) const;
+ void Deserialize(Archive & rArchive);
+ void Serialize(Archive & rArchive) const;
+
void AddDefiniteEntries(const std::string &rEntries);
void AddRegexEntries(const std::string &rEntries);
@@ -98,7 +98,7 @@
private:
std::set<std::string> mDefinite;
#ifndef PLATFORM_REGEX_NOT_SUPPORTED
- std::vector<regex_t *> mRegex;
+ std::vector<regex_t *> mRegex;
std::vector<std::string> mRegexStr; // save original regular expression string-based source for Serialize
#endif
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/ExcludeList.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/FdGetLine.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/FdGetLine.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/FileModificationTime.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/FileStream.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/FileStream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/Guards.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/IOStream.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/IOStream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/IOStreamGetLine.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/IOStreamGetLine.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/LinuxWorkaround.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/LinuxWorkaround.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/MainHelper.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/MemBlockStream.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/MemBlockStream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/MemLeakFindOff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/MemLeakFindOn.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/MemLeakFinder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/NamedLock.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/NamedLock.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/PartialReadStream.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/PartialReadStream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/ReadGatherStream.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/ReadGatherStream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/StreamableMemBlock.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/StreamableMemBlock.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/TemporaryDirectory.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/Test.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/UnixUser.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/UnixUser.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/Utils.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/Utils.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/WaitForEvent.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/common/WaitForEvent.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/compress/Compress.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/compress/CompressException.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/compress/CompressStream.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/compress/CompressStream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/crypto/CipherAES.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/crypto/CipherAES.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/crypto/CipherBlowfish.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/crypto/CipherBlowfish.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/crypto/CipherContext.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/crypto/CipherContext.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/crypto/CipherDescription.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/crypto/CipherDescription.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/crypto/CipherException.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/crypto/MD5Digest.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/crypto/MD5Digest.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/crypto/Random.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/crypto/Random.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/crypto/RollingChecksum.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/crypto/RollingChecksum.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/raidfile/RaidFileController.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/raidfile/RaidFileController.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/raidfile/RaidFileException.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/raidfile/RaidFileRead.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/raidfile/RaidFileRead.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/raidfile/RaidFileUtil.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/raidfile/RaidFileUtil.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/raidfile/RaidFileWrite.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/raidfile/RaidFileWrite.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/Daemon.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/Daemon.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/LocalProcessStream.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/LocalProcessStream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/Protocol.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/Protocol.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/ProtocolObject.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/ProtocolObject.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/ProtocolUncertainStream.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/ProtocolUncertainStream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/ProtocolWire.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/SSLLib.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/SSLLib.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/ServerException.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/ServerStream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/ServerTLS.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/Socket.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/Socket.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/SocketListen.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/SocketStream.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/SocketStream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/SocketStreamTLS.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/SocketStreamTLS.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/TLSContext.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/lib/server/TLSContext.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/test/backupdiff/difftestfiles.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/test/backupdiff/testbackupdiff.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/test/backupstore/testbackupstore.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/test/backupstorefix/testbackupstorefix.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/test/backupstorepatch/testbackupstorepatch.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/test/basicserver/TestCommands.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/test/basicserver/TestContext.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/test/basicserver/TestContext.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/test/basicserver/testbasicserver.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/test/bbackupd/testbbackupd.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/test/common/testcommon.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/test/compress/testcompress.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/test/crypto/testcrypto.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: box/gary/boxbackup-0.09-mod/test/raidfile/Darwin-SYS.h
===================================================================
--- box/gary/boxbackup-0.09-mod/test/raidfile/Darwin-SYS.h 2006-01-17 22:27:22 UTC (rev 320)
+++ box/gary/boxbackup-0.09-mod/test/raidfile/Darwin-SYS.h 2006-01-17 22:43:33 UTC (rev 321)
@@ -37,170 +37,170 @@
//
//
//
-
-/* Taken from the Darwin Libc source
-*/
-
-/*
- * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * The contents of this file constitute Original Code as defined in and
- * are subject to the Apple Public Source License Version 1.1 (the
- * "License"). You may not use this file except in compliance with the
- * License. Please obtain a copy of the License at
- * http://www.apple.com/publicsource and read it before using this file.
- *
- * This Original Code and all software distributed under the License are
- * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved.
- *
- * File: SYS.h
- *
- * Definition of the user side of the UNIX system call interface
- * for M98K.
- *
- * Errors are flagged by the location of the trap return (ie., which
- * instruction is executed upon rfi):
- *
- * SC PC + 4: Error (typically branch to cerror())
- * SC PC + 8: Success
- *
- * HISTORY
- * 18-Nov-92 Ben Fathi (benf@next.com)
- * Ported to m98k.
- *
- * 9-Jan-92 Peter King (king@next.com)
- * Created.
- */
-
-#define KERNEL_PRIVATE 1
-/*
- * Header files.
- */
-#import <architecture/ppc/asm_help.h>
-#import <architecture/ppc/pseudo_inst.h>
-#import <mach/ppc/exception.h>
-#import <sys/syscall.h>
-
-/* From rhapsody kernel mach/ppc/syscall_sw.h */
-#define kernel_trap_args_0
-#define kernel_trap_args_1
-#define kernel_trap_args_2
-#define kernel_trap_args_3
-#define kernel_trap_args_4
-#define kernel_trap_args_5
-#define kernel_trap_args_6
-#define kernel_trap_args_7
-
-/*
- * simple_kernel_trap -- Mach system calls with 8 or less args
- * Args are passed in a0 - a7, system call number in r0.
- * Do a "sc" instruction to enter kernel.
- */
-#define simple_kernel_trap(trap_name, trap_number) \
- .globl _##trap_name @\
-_##trap_name: @\
- li r0,trap_number @\
- sc @\
- blr @\
- END(trap_name)
-
-#define kernel_trap_0(trap_name,trap_number) \
- simple_kernel_trap(trap_name,trap_number)
-
-#define kernel_trap_1(trap_name,trap_number) \
- simple_kernel_trap(trap_name,trap_number)
-
-#define kernel_trap_2(trap_name,trap_number) \
- simple_kernel_trap(trap_name,trap_number)
-
-#define kernel_trap_3(trap_name,trap_number) \
- simple_kernel_trap(trap_name,trap_number)
-
-#define kernel_trap_4(trap_name,trap_number) \
- simple_kernel_trap(trap_name,trap_number)
-
-#define kernel_trap_5(trap_name,trap_number) \
- simple_kernel_trap(trap_name,trap_number)
-
-#define kernel_trap_6(trap_name,trap_number) \
- simple_kernel_trap(trap_name,trap_number)
-
-#define kernel_trap_7(trap_name,trap_number) \
- simple_kernel_trap(trap_name,trap_number)
-
-#define kernel_trap_8(trap_name,trap_number) \
- simple_kernel_trap(trap_name,trap_number)
-
-#define kernel_trap_9(trap_name,trap_number) \
- simple_kernel_trap(trap_name,trap_number)
-
-/* End of rhapsody kernel mach/ppc/syscall_sw.h */
-
-/*
- * Macros.
- */
-
-#define SYSCALL(name, nargs) \
- .globl cerror @\
-LEAF(_##name) @\
- kernel_trap_args_##nargs @\
- li r0,SYS_##name @\
- sc @\
- b 1f @\
- b 2f @\
-1: BRANCH_EXTERN(cerror) @\
-.text \
-2: nop
-
-#define SYSCALL_NONAME(name, nargs) \
- .globl cerror @\
- kernel_trap_args_##nargs @\
- li r0,SYS_##name @\
- sc @\
- b 1f @\
- b 2f @\
-1: BRANCH_EXTERN(cerror) @\
-.text \
-2: nop
-
-#define PSEUDO(pseudo, name, nargs) \
-LEAF(_##pseudo) @\
- SYSCALL_NONAME(name, nargs)
-
-
-#undef END
-#import <mach/ppc/syscall_sw.h>
-
-#if !defined(SYS_getdirentriesattr)
-#define SYS_getdirentriesattr 222
-#endif
-
-#if !defined(SYS_semsys)
-#define SYS_semsys 251
-#define SYS_msgsys 252
-#define SYS_shmsys 253
-#define SYS_semctl 254
-#define SYS_semget 255
-#define SYS_semop 256
-#define SYS_semconfig 257
-#define SYS_msgctl 258
-#define SYS_msgget 259
-#define SYS_msgsnd 260
-#define SYS_msgrcv 261
-#define SYS_shmat 262
-#define SYS_shmctl 263
-#define SYS_shmdt 264
-#define SYS_shmget 265
-#endif
-
+
+/* Taken from the Darwin Libc source
+*/
+
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * The contents of this file constitute Original Code as defined in and
+ * are subject to the Apple Public Source License Version 1.1 (the
+ * "License"). You may not use this file except in compliance with the
+ * License. Please obtain a copy of the License at
+ * http://www.apple.com/publicsource and read it before using this file.
+ *
+ * This Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved.
+ *
+ * File: SYS.h
+ *
+ * Definition of the user side of the UNIX system call interface
+ * for M98K.
+ *
+ * Errors are flagged by the location of the trap return (ie., which
+ * instruction is executed upon rfi):
+ *
+ * SC PC + 4: Error (typically branch to cerror())
+ * SC PC + 8: Success
+ *
+ * HISTORY
+ * 18-Nov-92 Ben Fathi (benf@next.com)
+ * Ported to m98k.
+ *
+ * 9-Jan-92 Peter King (king@next.com)
+ * Created.
+ */
+
+#define KERNEL_PRIVATE 1
+/*
+ * Header files.
+ */
+#import <architecture/ppc/asm_help.h>
+#import <architecture/ppc/pseudo_inst.h>
+#import <mach/ppc/exception.h>
+#import <sys/syscall.h>
+
+/* From rhapsody kernel mach/ppc/syscall_sw.h */
+#define kernel_trap_args_0
+#define kernel_trap_args_1
+#define kernel_trap_args_2
+#define kernel_trap_args_3
+#define kernel_trap_args_4
+#define kernel_trap_args_5
+#define kernel_trap_args_6
+#define kernel_trap_args_7
+
+/*
+ * simple_kernel_trap -- Mach system calls with 8 or less args
+ * Args are passed in a0 - a7, system call number in r0.
+ * Do a "sc" instruction to enter kernel.
+ */
+#define simple_kernel_trap(trap_name, trap_number) \
+ .globl _##trap_name @\
+_##trap_name: @\
+ li r0,trap_number @\
+ sc @\
+ blr @\
+ END(trap_name)
+
+#define kernel_trap_0(trap_name,trap_number) \
+ simple_kernel_trap(trap_name,trap_number)
+
+#define kernel_trap_1(trap_name,trap_number) \
+ simple_kernel_trap(trap_name,trap_number)
+
+#define kernel_trap_2(trap_name,trap_number) \
+ simple_kernel_trap(trap_name,trap_number)
+
+#define kernel_trap_3(trap_name,trap_number) \
+ simple_kernel_trap(trap_name,trap_number)
+
+#define kernel_trap_4(trap_name,trap_number) \
+ simple_kernel_trap(trap_name,trap_number)
+
+#define kernel_trap_5(trap_name,trap_number) \
+ simple_kernel_trap(trap_name,trap_number)
+
+#define kernel_trap_6(trap_name,trap_number) \
+ simple_kernel_trap(trap_name,trap_number)
+
+#define kernel_trap_7(trap_name,trap_number) \
+ simple_kernel_trap(trap_name,trap_number)
+
+#define kernel_trap_8(trap_name,trap_number) \
+ simple_kernel_trap(trap_name,trap_number)
+
+#define kernel_trap_9(trap_name,trap_number) \
+ simple_kernel_trap(trap_name,trap_number)
+
+/* End of rhapsody kernel mach/ppc/syscall_sw.h */
+
+/*
+ * Macros.
+ */
+
+#define SYSCALL(name, nargs) \
+ .globl cerror @\
+LEAF(_##name) @\
+ kernel_trap_args_##nargs @\
+ li r0,SYS_##name @\
+ sc @\
+ b 1f @\
+ b 2f @\
+1: BRANCH_EXTERN(cerror) @\
+.text \
+2: nop
+
+#define SYSCALL_NONAME(name, nargs) \
+ .globl cerror @\
+ kernel_trap_args_##nargs @\
+ li r0,SYS_##name @\
+ sc @\
+ b 1f @\
+ b 2f @\
+1: BRANCH_EXTERN(cerror) @\
+.text \
+2: nop
+
+#define PSEUDO(pseudo, name, nargs) \
+LEAF(_##pseudo) @\
+ SYSCALL_NONAME(name, nargs)
+
+
+#undef END
+#import <mach/ppc/syscall_sw.h>
+
+#if !defined(SYS_getdirentriesattr)
+#define SYS_getdirentriesattr 222
+#endif
+
+#if !defined(SYS_semsys)
+#define SYS_semsys 251
+#define SYS_msgsys 252
+#define SYS_shmsys 253
+#define SYS_semctl 254
+#define SYS_semget 255
+#define SYS_semop 256
+#define SYS_semconfig 257
+#define SYS_msgctl 258
+#define SYS_msgget 259
+#define SYS_msgsnd 260
+#define SYS_msgrcv 261
+#define SYS_shmat 262
+#define SYS_shmctl 263
+#define SYS_shmdt 264
+#define SYS_shmget 265
+#endif
+
Property changes on: box/gary/boxbackup-0.09-mod/test/raidfile/Darwin-SYS.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/test/raidfile/intercept.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: box/gary/boxbackup-0.09-mod/test/raidfile/testraidfile.cpp
___________________________________________________________________
Name: svn:eol-style
+ native