summaryrefslogtreecommitdiff
path: root/src/client/Response.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-08-12 20:10:37 +0200
committerMax Kellermann <max@musicpd.org>2019-08-12 20:23:46 +0200
commit4f61cd0b9346d61316ec3d2efd75ee90325e4f18 (patch)
treef7524d64f57e88ea3edbb3a58ba144c2d0576f84 /src/client/Response.cxx
parent989790e7f172cf74c3adabb8971f62ba0311ab3a (diff)
client/Response: add constant MAX_BINARY_SIZE
Use the same chunk size for all binary commands.
Diffstat (limited to 'src/client/Response.cxx')
-rw-r--r--src/client/Response.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/client/Response.cxx b/src/client/Response.cxx
index 9d85a27e6..4d1b575d2 100644
--- a/src/client/Response.cxx
+++ b/src/client/Response.cxx
@@ -59,6 +59,8 @@ Response::Format(const char *fmt, ...) noexcept
bool
Response::WriteBinary(ConstBuffer<void> payload) noexcept
{
+ assert(payload.size <= MAX_BINARY_SIZE);
+
return Format("binary: %zu\n", payload.size) &&
Write(payload.data, payload.size) &&
Write("\n");