summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2007-04-29 21:31:14 +0000
committerChris Wilson <chris+github@qwirx.com>2007-04-29 21:31:14 +0000
commit88208fa390db67217cbe5433d88fc7ee99b4944b (patch)
tree519b83f6a9d74df60227bde6448383142f29f46f
parent08f4df17d8139952c5023f42859b7e06c0738d29 (diff)
Read any remaining data from the encoded stream (such as EOF marker)
before discarding it, to ensure that we don't break the protocol. (refs #2, refs #3)
-rw-r--r--bin/bbackupquery/BackupQueries.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/bin/bbackupquery/BackupQueries.cpp b/bin/bbackupquery/BackupQueries.cpp
index fd83780a..7f511b74 100644
--- a/bin/bbackupquery/BackupQueries.cpp
+++ b/bin/bbackupquery/BackupQueries.cpp
@@ -1695,7 +1695,7 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s
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 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s
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());
+ }
+ }
}
}