summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/server/Protocol.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/server/Protocol.cpp b/lib/server/Protocol.cpp
index 82836007..382f1c37 100644
--- a/lib/server/Protocol.cpp
+++ b/lib/server/Protocol.cpp
@@ -688,6 +688,17 @@ void Protocol::SendStream(IOStream &rStream)
// Can't send this using the fixed size header
uncertainSize = true;
}
+
+ if(streamSize == 0)
+ {
+ // Server protocol will throw an assertion failure if we
+ // try to send a stream whose size is definitely zero:
+ // ASSERT FAILED: [BytesToRead > 0] at PartialReadStream.cpp:31
+ // so catch this on the client side to help debugging
+ THROW_EXCEPTION_MESSAGE(ServerException, Protocol_BadUsage,
+ "Sending a stream with a definite size of zero "
+ "is not allowed in the protocol");
+ }
// Inform sub class
InformStreamSending(streamSize);