[Box Backup-commit] COMMIT r1754 - box/chris/merge/bin/bbackupd

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Thu, 26 Jul 2007 22:54:32 +0100


Author: chris
Date: 2007-07-26 22:54:32 +0100 (Thu, 26 Jul 2007)
New Revision: 1754

Modified:
   box/chris/merge/bin/bbackupd/BackupClientContext.cpp
Log:
Apply Gary's patch from ticket #19 to respect the server's hard limit
rather than the soft limit. This allows setting the soft limit to zero,
so that housekeeping will remove all old versions of all files.
(refs #19, refs #3, merges [1659])


Modified: box/chris/merge/bin/bbackupd/BackupClientContext.cpp
===================================================================
--- box/chris/merge/bin/bbackupd/BackupClientContext.cpp	2007-07-26 21:54:04 UTC (rev 1753)
+++ box/chris/merge/bin/bbackupd/BackupClientContext.cpp	2007-07-26 21:54:32 UTC (rev 1754)
@@ -197,16 +197,12 @@
 		::syslog(LOG_INFO, "Connection made, login successful");
 
 		// Check to see if there is any space available on the server
-		int64_t softLimit = loginConf->GetBlocksSoftLimit();
-		int64_t hardLimit = loginConf->GetBlocksHardLimit();
-		// Threshold for uploading new stuff
-		int64_t stopUploadThreshold = softLimit + ((hardLimit - softLimit) / 3);
-		if(loginConf->GetBlocksUsed() > stopUploadThreshold)
+		if(loginConf->GetBlocksUsed() >= loginConf->GetBlocksHardLimit())
 		{
 			// no -- flag so only things like deletions happen
 			mStorageLimitExceeded = true;
 			// Log
-			::syslog(LOG_WARNING, "Exceeded storage limits on server -- not uploading changes to files");
+			::syslog(LOG_WARNING, "Exceeded storage hard-limit on server -- not uploading changes to files");
 		}
 	}
 	catch(...)