[Box Backup-commit] COMMIT r1639 - box/chris/general/bin/bbackupquery

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Wed May 9 11:32:39 BST 2007


Author: chris
Date: 2007-05-09 11:32:38 +0100 (Wed, 09 May 2007)
New Revision: 1639

Modified:
   box/chris/general/bin/bbackupquery/BackupQueries.cpp
Log:
Read any remaining data from the encoded stream (such as EOF marker)
before discarding it, to ensure that we don't break the protocol.
(merges [1623])


Modified: box/chris/general/bin/bbackupquery/BackupQueries.cpp
===================================================================
--- box/chris/general/bin/bbackupquery/BackupQueries.cpp	2007-05-09 10:32:02 UTC (rev 1638)
+++ box/chris/general/bin/bbackupquery/BackupQueries.cpp	2007-05-09 10:32:38 UTC (rev 1639)
@@ -1695,7 +1695,7 @@
 								equal = false;
 							}
 
-							// Must always read the entire decoded string, if it's not a symlink
+							// Must always read the entire decoded stream, if it's not a symlink
 							if(fileOnServerStream->StreamDataLeft())
 							{
 								// Absorb all the data remaining
@@ -1705,6 +1705,17 @@
 									fileOnServerStream->Read(buffer, sizeof(buffer), mrConnection.GetTimeout());
 								}
 							}
+
+							// Must always read the entire encoded stream
+							if(objectStream->StreamDataLeft())
+							{
+								// Absorb all the data remaining
+								char buffer[2048];
+								while(objectStream->StreamDataLeft())
+								{
+									objectStream->Read(buffer, sizeof(buffer), mrConnection.GetTimeout());
+								}
+							}
 						}
 					}
 




More information about the Boxbackup-commit mailing list