[Box Backup-commit] COMMIT r1598 - box/chris/merge/lib/backupclient
boxbackup-dev at fluffy.co.uk
boxbackup-dev at fluffy.co.uk
Sat Apr 28 20:57:24 BST 2007
Author: chris
Date: 2007-04-28 20:57:24 +0100 (Sat, 28 Apr 2007)
New Revision: 1598
Modified:
box/chris/merge/lib/backupclient/BackupStoreFile.cpp
Log:
Fix getting files with uncertain size (over 2GB) from the store. Failure
to drain the stream will leave the EOF byte in it, which breaks further
communications with the store over the same connection. (refs #2, refs #3)
Modified: box/chris/merge/lib/backupclient/BackupStoreFile.cpp
===================================================================
--- box/chris/merge/lib/backupclient/BackupStoreFile.cpp 2007-04-28 17:37:37 UTC (rev 1597)
+++ box/chris/merge/lib/backupclient/BackupStoreFile.cpp 2007-04-28 19:57:24 UTC (rev 1598)
@@ -292,6 +292,14 @@
}
out.Close();
+
+ // The stream might have uncertain size, in which case
+ // we need to drain it to get the
+ // Protocol::ProtocolStreamHeader_EndOfStream byte
+ // out of our connection stream.
+ char buffer[1];
+ int drained = rEncodedFile.Read(buffer, 1);
+ ASSERT(drained == 0);
// Write the attributes
stream->GetAttributes().WriteAttributes(DecodedFilename);
More information about the Boxbackup-commit
mailing list