diff --git a/src/lib/client/Client.cpp b/src/lib/client/Client.cpp index 30f0e85ee..68c9319eb 100644 --- a/src/lib/client/Client.cpp +++ b/src/lib/client/Client.cpp @@ -344,6 +344,16 @@ void Client::setOptions(const OptionsList &options) index++; if (index != options.end()) { m_maximumClipboardSize = *index; + // the server is authoritative for the shared clipboard limit, so apply it + // to the receive path as well. without this, the receive cap keeps the + // value computed from this machine's own setting in the constructor, and a + // server configured with a larger limit has its transfers rejected here + // with "clipboard size exceeds limit" -- a failure that shows up only in + // the server -> client direction, since the send cap above is already + // driven by this option. + // + // the option is in KiB; m_maximumClipboardReceiveSize is in bytes. + m_maximumClipboardReceiveSize = static_cast(*index) * 1024; } } else if (id == kOptionRelativeMouseMoves) { index++;