[Box Backup-commit] COMMIT r3397 - in box/trunk: lib/common test/bbackupd
subversion at boxbackup.org
subversion at boxbackup.org
Thu Sep 4 02:36:56 BST 2014
Author: chris
Date: 2014-09-04 02:36:56 +0100 (Thu, 04 Sep 2014)
New Revision: 3397
Modified:
box/trunk/lib/common/StreamableMemBlock.cpp
box/trunk/test/bbackupd/testbbackupd.cpp
Log:
Add missing timeouts in StreamableMemBlock::Set and testbbackupd.
Reduces warnings about network operations with no timeout. May prevent some
hangs that might have occurred waiting forever for network data in the past.
Modified: box/trunk/lib/common/StreamableMemBlock.cpp
===================================================================
--- box/trunk/lib/common/StreamableMemBlock.cpp 2014-09-04 01:36:54 UTC (rev 3396)
+++ box/trunk/lib/common/StreamableMemBlock.cpp 2014-09-04 01:36:56 UTC (rev 3397)
@@ -125,7 +125,9 @@
try
{
// Read in
- if(!rStream.ReadFullBuffer(pblock, size, 0 /* not interested in bytes read if this fails */))
+ if(!rStream.ReadFullBuffer(pblock, size,
+ 0 /* not interested in bytes read if this fails */,
+ Timeout))
{
THROW_EXCEPTION(CommonException, StreamableMemBlockIncompleteRead)
}
Modified: box/trunk/test/bbackupd/testbbackupd.cpp
===================================================================
--- box/trunk/test/bbackupd/testbbackupd.cpp 2014-09-04 01:36:54 UTC (rev 3396)
+++ box/trunk/test/bbackupd/testbbackupd.cpp 2014-09-04 01:36:56 UTC (rev 3397)
@@ -87,6 +87,7 @@
// two cycles and a bit
#define TIME_TO_WAIT_FOR_BACKUP_OPERATION 12
+#define SHORT_TIMEOUT 5000
std::string current_test_name;
std::map<std::string, std::string> s_test_status;
@@ -777,7 +778,7 @@
std::auto_ptr<BackupProtocolSuccess> dirreply(
rClient.QueryListDirectory(id, false, 0, false));
std::auto_ptr<BackupStoreDirectory> apDir(
- new BackupStoreDirectory(rClient.ReceiveStream()));
+ new BackupStoreDirectory(rClient.ReceiveStream(), SHORT_TIMEOUT));
return apDir;
}
More information about the Boxbackup-commit
mailing list