summaryrefslogtreecommitdiff
path: root/bin/bbackupd
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2006-08-30 13:46:28 +0000
committerChris Wilson <chris+github@qwirx.com>2006-08-30 13:46:28 +0000
commit03fb61742165f24752e6392122d8d9a97366df27 (patch)
treebb7304ecf3cf38e9e541f3f2dc9d8c0570ea06b0 /bin/bbackupd
parent535ab4aec14fd9ac2753762beb28d01114753a82 (diff)
* bin/bbackupd/BackupClientDirectoryRecord.cpp
Diffstat (limited to 'bin/bbackupd')
-rw-r--r--bin/bbackupd/BackupClientDirectoryRecord.cpp91
1 files changed, 25 insertions, 66 deletions
diff --git a/bin/bbackupd/BackupClientDirectoryRecord.cpp b/bin/bbackupd/BackupClientDirectoryRecord.cpp
index 946f2bb8..5dc89a32 100644
--- a/bin/bbackupd/BackupClientDirectoryRecord.cpp
+++ b/bin/bbackupd/BackupClientDirectoryRecord.cpp
@@ -674,72 +674,31 @@ bool BackupClientDirectoryRecord::UpdateItems(BackupClientDirectoryRecord::SyncP
// modification time within sync period
// if it's been seen before but not uploaded, is the time from this first sight longer than the MaxUploadWait
// and if we know about it from a directory listing, that it hasn't got the same upload time as on the store
-
- bool doUpload = false;
-
- // Only upload a file if the mod time locally is
- // different to that on the server.
-
- if (en == 0 || en->GetModificationTime() != modTime)
- {
- // Check the file modified within the acceptable time period we're checking
- // If the file isn't on the server, the acceptable time starts at zero.
- // Check pDirOnStore and en, because if we didn't download a directory listing,
- // pDirOnStore will be zero, but we know it's on the server.
- if (modTime < rParams.mSyncPeriodEnd)
- {
- if (pDirOnStore != 0 && en == 0)
- {
- doUpload = true;
- }
- else if (modTime >= rParams.mSyncPeriodStart)
- {
- doUpload = true;
- }
- }
-
- // However, just in case things are continually
- // modified, we check the first seen time.
- // The two compares of syncPeriodEnd and
- // pendingFirstSeenTime are because the values
- // are unsigned.
-
- if (!doUpload &&
- pendingFirstSeenTime != 0 &&
- rParams.mSyncPeriodEnd > pendingFirstSeenTime &&
- (rParams.mSyncPeriodEnd - pendingFirstSeenTime)
- > rParams.mMaxUploadWait)
- {
- doUpload = true;
- }
-
- // Then make sure that if files are added with a
- // time less than the sync period start
- // (which can easily happen on file server), it
- // gets uploaded. The directory contents checksum
- // will pick up the fact it has been added, so the
- // store listing will be available when this happens.
-
- if (!doUpload &&
- modTime <= rParams.mSyncPeriodStart &&
- en != 0 &&
- en->GetModificationTime() != modTime)
- {
- doUpload = true;
- }
-
- // And just to catch really badly off clocks in
- // the future for file server clients,
- // just upload the file if it's madly in the future.
-
- if (!doUpload && modTime >
- rParams.mUploadAfterThisTimeInTheFuture)
- {
- doUpload = true;
- }
- }
-
- if (doUpload)
+ if(
+ (
+ // Check the file modified within the acceptable time period we're checking
+ // If the file isn't on the server, the acceptable time starts at zero.
+ // Check pDirOnStore and en, because if we didn't download a directory listing,
+ // pDirOnStore will be zero, but we know it's on the server.
+ ( ((pDirOnStore != 0 && en == 0) || (modTime >= rParams.mSyncPeriodStart)) && modTime < rParams.mSyncPeriodEnd)
+
+ // However, just in case things are continually modified, we check the first seen time.
+ // The two compares of syncPeriodEnd and pendingFirstSeenTime are because the values are unsigned.
+ || (pendingFirstSeenTime != 0 &&
+ (rParams.mSyncPeriodEnd > pendingFirstSeenTime)
+ && ((rParams.mSyncPeriodEnd - pendingFirstSeenTime) > rParams.mMaxUploadWait))
+
+ // Then make sure that if files are added with a time less than the sync period start
+ // (which can easily happen on file server), it gets uploaded. The directory contents checksum
+ // will pick up the fact it has been added, so the store listing will be available when this happens.
+ || ((modTime <= rParams.mSyncPeriodStart) && (en != 0) && (en->GetModificationTime() != modTime))
+
+ // And just to catch really badly off clocks in the future for file server clients,
+ // just upload the file if it's madly in the future.
+ || (modTime > rParams.mUploadAfterThisTimeInTheFuture)
+ )
+ // But even then, only upload it if the mod time locally is different to that on the server.
+ && (en == 0 || en->GetModificationTime() != modTime))
{
// Make sure we're connected -- must connect here so we know whether
// the storage limit has been exceeded, and hence whether or not