summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2021-01-21 17:42:26 +0100
committerMax Kellermann <max@musicpd.org>2021-01-21 17:42:26 +0100
commit8279cafd6d5c2d73c2b200eaf3a7b6e1429fb26c (patch)
tree0ef390bac9392d6b525a2263495f439c67d13a43 /src/client
parent014c2a82bd16e4ac5c76c4c713817a41ff800aec (diff)
parenta0d76c3be93738f2e21aeada3612a73bc05ca816 (diff)
Merge tag 'v0.22.4'
release v0.22.4
Diffstat (limited to 'src/client')
-rw-r--r--src/client/Client.hxx7
-rw-r--r--src/client/Response.cxx2
-rw-r--r--src/client/Response.hxx4
3 files changed, 10 insertions, 3 deletions
diff --git a/src/client/Client.hxx b/src/client/Client.hxx
index d19d08760..deb4b8caa 100644
--- a/src/client/Client.hxx
+++ b/src/client/Client.hxx
@@ -84,6 +84,12 @@ public:
*/
TagMask tag_mask = TagMask::All();
+ /**
+ * The maximum number of bytes transmitted in a binary
+ * response. Can be changed with the "binarylimit" command.
+ */
+ size_t binary_limit = 8192;
+
private:
static constexpr size_t MAX_SUBSCRIPTIONS = 16;
@@ -122,6 +128,7 @@ public:
~Client() noexcept;
using FullyBufferedSocket::GetEventLoop;
+ using FullyBufferedSocket::GetOutputMaxSize;
gcc_pure
bool IsExpired() const noexcept {
diff --git a/src/client/Response.cxx b/src/client/Response.cxx
index 3900df75e..0c9145a50 100644
--- a/src/client/Response.cxx
+++ b/src/client/Response.cxx
@@ -59,7 +59,7 @@ Response::Format(const char *fmt, ...) noexcept
bool
Response::WriteBinary(ConstBuffer<void> payload) noexcept
{
- assert(payload.size <= MAX_BINARY_SIZE);
+ assert(payload.size <= client.binary_limit);
return Format("binary: %zu\n", payload.size) &&
Write(payload.data, payload.size) &&
diff --git a/src/client/Response.hxx b/src/client/Response.hxx
index 1bf0e7c1e..4c7e40e8a 100644
--- a/src/client/Response.hxx
+++ b/src/client/Response.hxx
@@ -75,9 +75,9 @@ public:
bool Write(const void *data, size_t length) noexcept;
bool Write(const char *data) noexcept;
bool FormatV(const char *fmt, std::va_list args) noexcept;
- bool Format(const char *fmt, ...) noexcept;
- static constexpr size_t MAX_BINARY_SIZE = 8192;
+ gcc_printf(2,3)
+ bool Format(const char *fmt, ...) noexcept;
/**
* Write a binary chunk; this writes the "binary" line, the