fix: use local clipboard limit for client receive
This commit is contained in:
parent
8a535fd5dd
commit
bcd3a658fc
3 changed files with 9 additions and 5 deletions
|
|
@ -45,7 +45,10 @@ Client::Client(
|
|||
m_socketFactory(socketFactory),
|
||||
m_screen(screen),
|
||||
m_events(events),
|
||||
m_useSecureNetwork(Settings::value(Settings::Security::TlsEnabled).toBool())
|
||||
m_useSecureNetwork(Settings::value(Settings::Security::TlsEnabled).toBool()),
|
||||
m_maximumClipboardReceiveSize(
|
||||
static_cast<size_t>(Settings::value(Settings::Server::ClipboardSize).toUInt()) * 1024 * 1024
|
||||
)
|
||||
{
|
||||
assert(m_socketFactory != nullptr);
|
||||
assert(m_screen != nullptr);
|
||||
|
|
@ -175,9 +178,9 @@ NetworkAddress Client::getServerAddress() const
|
|||
return m_serverAddress;
|
||||
}
|
||||
|
||||
size_t Client::getMaximumClipboardSizeBytes() const
|
||||
size_t Client::getMaximumClipboardReceiveSizeBytes() const
|
||||
{
|
||||
return m_maximumClipboardSize * 1024;
|
||||
return m_maximumClipboardReceiveSize;
|
||||
}
|
||||
|
||||
void *Client::getEventTarget() const
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ public:
|
|||
{
|
||||
return m_resolvedAddressesCount;
|
||||
}
|
||||
size_t getMaximumClipboardSizeBytes() const;
|
||||
size_t getMaximumClipboardReceiveSizeBytes() const;
|
||||
|
||||
//@}
|
||||
|
||||
|
|
@ -206,6 +206,7 @@ private:
|
|||
bool m_hasRelativeRestorePosition = false;
|
||||
int32_t m_relativeRestoreX = 0;
|
||||
int32_t m_relativeRestoreY = 0;
|
||||
size_t m_maximumClipboardReceiveSize = 0;
|
||||
size_t m_maximumClipboardSize = INT_MAX;
|
||||
size_t m_resolvedAddressesCount = 0;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -534,7 +534,7 @@ void ServerProxy::setClipboard()
|
|||
uint32_t seq;
|
||||
|
||||
auto r = ClipboardChunk::assemble(
|
||||
m_stream, m_clipboardDataCached, id, seq, m_clipboardChunkState, m_client->getMaximumClipboardSizeBytes()
|
||||
m_stream, m_clipboardDataCached, id, seq, m_clipboardChunkState, m_client->getMaximumClipboardReceiveSizeBytes()
|
||||
);
|
||||
|
||||
if (r == TransferState::Started) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue