summaryrefslogtreecommitdiff
path: root/lib/backupclient
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2006-12-03 10:40:26 +0000
committerChris Wilson <chris+github@qwirx.com>2006-12-03 10:40:26 +0000
commite0a80f0da840849a5cdb38bcfea7a7e240a2aa2d (patch)
treeee3c2b1327a16bf04f4f1fa9507af88d7d438df0 /lib/backupclient
parent7a47551a8c2eba625a1f32c4c7dd61015ebeaa36 (diff)
Moved KeepAlive timer to BackupClientContext object.
Made timeout initialisation non-static, and a property of the context object. (perhaps should be in rParams, I know). (refs #3, refs #9)
Diffstat (limited to 'lib/backupclient')
-rw-r--r--lib/backupclient/BackupStoreFile.h7
-rw-r--r--lib/backupclient/BackupStoreFileDiff.cpp13
2 files changed, 6 insertions, 14 deletions
diff --git a/lib/backupclient/BackupStoreFile.h b/lib/backupclient/BackupStoreFile.h
index 784320b6..3ee5ddb0 100644
--- a/lib/backupclient/BackupStoreFile.h
+++ b/lib/backupclient/BackupStoreFile.h
@@ -50,10 +50,9 @@ public:
DiffTimer();
virtual ~DiffTimer();
public:
- virtual void DoKeepAlive() = 0;
- virtual int GetMaximumDiffingTime() = 0;
- virtual int GetKeepAliveTime() = 0;
- virtual bool IsManaged() = 0;
+ virtual void DoKeepAlive() = 0;
+ virtual int GetMaximumDiffingTime() = 0;
+ virtual bool IsManaged() = 0;
};
// --------------------------------------------------------------------------
diff --git a/lib/backupclient/BackupStoreFileDiff.cpp b/lib/backupclient/BackupStoreFileDiff.cpp
index d04cda6c..3a3f1a5e 100644
--- a/lib/backupclient/BackupStoreFileDiff.cpp
+++ b/lib/backupclient/BackupStoreFileDiff.cpp
@@ -460,12 +460,10 @@ static void SearchForMatchingBlocks(IOStream &rFile, std::map<int64_t, int64_t>
int32_t Sizes[BACKUP_FILE_DIFF_MAX_BLOCK_SIZES], DiffTimer *pDiffTimer)
{
Timer maximumDiffingTime(0);
- Timer keepAliveTime(0);
- if (pDiffTimer && pDiffTimer->IsManaged())
+ if(pDiffTimer && pDiffTimer->IsManaged())
{
maximumDiffingTime = Timer(pDiffTimer->GetMaximumDiffingTime());
- keepAliveTime = Timer(pDiffTimer->GetKeepAliveTime());
}
std::map<int64_t, int32_t> goodnessOfFit;
@@ -560,16 +558,11 @@ static void SearchForMatchingBlocks(IOStream &rFile, std::map<int64_t, int64_t>
break;
}
- if(keepAliveTime.HasExpired())
+ if(pDiffTimer)
{
- ASSERT(pDiffTimer != NULL);
- TRACE0("KeepAliveTime reached - "
- "initiating keep-alive\n");
pDiffTimer->DoKeepAlive();
- keepAliveTime = Timer(
- pDiffTimer->GetKeepAliveTime());
}
-
+
// Load in another block of data, and record how big it is
int bytesInEndings = rFile.Read(endings, Sizes[s]);
int tmp;