summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2006-12-03 10:41:01 +0000
committerChris Wilson <chris+github@qwirx.com>2006-12-03 10:41:01 +0000
commit3728ab83d06d0e4e7f1739ec4e7480aaeaf0846d (patch)
tree49b5845adcf82c24eb2ffb1f6207a83bafb9d708
parente0a80f0da840849a5cdb38bcfea7a7e240a2aa2d (diff)
Send keepalives when needed while scanning large directories (refs #3,
refs #9)
-rw-r--r--bin/bbackupd/BackupClientDirectoryRecord.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/bbackupd/BackupClientDirectoryRecord.cpp b/bin/bbackupd/BackupClientDirectoryRecord.cpp
index 1db6cbe5..c05a23fc 100644
--- a/bin/bbackupd/BackupClientDirectoryRecord.cpp
+++ b/bin/bbackupd/BackupClientDirectoryRecord.cpp
@@ -223,6 +223,8 @@ void BackupClientDirectoryRecord::SyncDirectory(BackupClientDirectoryRecord::Syn
std::string filename;
while((en = ::readdir(dirHandle)) != 0)
{
+ rParams.mrContext.DoKeepAlive();
+
// Don't need to use LinuxWorkaround_FinishDirentStruct(en, rLocalPath.c_str());
// on Linux, as a stat is performed to get all this info
@@ -574,6 +576,9 @@ bool BackupClientDirectoryRecord::UpdateItems(BackupClientDirectoryRecord::SyncP
for(std::vector<std::string>::const_iterator f = rFiles.begin();
f != rFiles.end(); ++f)
{
+ // Send keep-alive message if needed
+ rParams.mrContext.DoKeepAlive();
+
// Filename of this file
std::string filename(MakeFullPath(rLocalPath, *f));
@@ -921,6 +926,9 @@ bool BackupClientDirectoryRecord::UpdateItems(BackupClientDirectoryRecord::SyncP
for(std::vector<std::string>::const_iterator d = rDirs.begin();
d != rDirs.end(); ++d)
{
+ // Send keep-alive message if needed
+ rParams.mrContext.DoKeepAlive();
+
// Get the local filename
std::string dirname(MakeFullPath(rLocalPath, *d));