[Box Backup-dev] COMMIT r515 - box/chris/general/bin/bbackupd

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Sun, 26 Feb 2006 00:27:48 +0000 (GMT)


Author: chris
Date: 2006-02-26 00:27:45 +0000 (Sun, 26 Feb 2006)
New Revision: 515

Modified:
   box/chris/general/bin/bbackupd/BackupDaemon.cpp
Log:
* BackupDaemon.cpp
- Fixed an infinite loop after a backup fails to complete when 
  StoreInfoObjectFile is disabled (sorry!)
- Unix compile fix


Modified: box/chris/general/bin/bbackupd/BackupDaemon.cpp
===================================================================
--- box/chris/general/bin/bbackupd/BackupDaemon.cpp	2006-02-26 00:26:26 UTC (rev 514)
+++ box/chris/general/bin/bbackupd/BackupDaemon.cpp	2006-02-26 00:27:45 UTC (rev 515)
@@ -580,6 +580,7 @@
 
  	bool deserialised = DeserializeStoreObjectInfo(clientStoreMarker, 
 		lastSyncTime, nextSyncTime);
+	bool was_deserialised = deserialised;
  
 	// --------------------------------------------------------------------------------------------
 	
@@ -696,6 +697,7 @@
 			// In case the backup throws an exception,
 			// we should not try to delete the store info
 			// object file again.
+			was_deserialised = deserialised;
 			deserialised = false;
 			
 			// Do sync
@@ -809,7 +811,7 @@
 				SerializeStoreObjectInfo(clientStoreMarker, lastSyncTime, nextSyncTime);
 				// Next time around, make sure we delete
 				// the store info object file.
-				deserialised = true;
+				deserialised = was_deserialised;
 
 				// --------------------------------------------------------------------------------------------
 			}
@@ -1237,8 +1239,8 @@
 			LeaveCriticalSection(&mMessageQueueLock);
 #else
 			message += "\n";
-			mpCommandSocketInfo->mpConnectedSocket->Write(message,
-				strlen(message));
+			mpCommandSocketInfo->mpConnectedSocket->Write(
+				message.c_str(), message.size());
 #endif
 		}
 		catch(...)