client/Response: add method WriteBinary()

Move code from read_stream_art().
This commit is contained in:
Max Kellermann
2019-08-12 14:17:35 +02:00
parent 831bc711ca
commit 989790e7f1
3 changed files with 19 additions and 8 deletions

View File

@@ -56,6 +56,14 @@ Response::Format(const char *fmt, ...) noexcept
return success;
}
bool
Response::WriteBinary(ConstBuffer<void> payload) noexcept
{
return Format("binary: %zu\n", payload.size) &&
Write(payload.data, payload.size) &&
Write("\n");
}
void
Response::Error(enum ack code, const char *msg) noexcept
{