Increase the maximum allowed message size in JSONRPC

Turns out 10KB can be exceeded with scripting
pull/358/head
Michael Zanetti 2020-11-24 15:58:50 +01:00
parent ae6a548d68
commit 504b88eddd
2 changed files with 3 additions and 3 deletions

View File

@ -621,8 +621,8 @@ void JsonRPCServerImplementation::processData(const QUuid &clientId, const QByte
}
m_clientBuffers[clientId] = buffer;
if (buffer.size() > 1024 * 10) {
qCWarning(dcJsonRpc()) << "Client buffer larger than 10KB and no valid data. Dropping client connection.";
if (buffer.size() > 1024 * 1024) {
qCWarning(dcJsonRpc()) << "Client buffer larger than 1MB and no valid data. Dropping client connection.";
interface->terminateClientConnection(clientId);
}
}

View File

@ -1379,7 +1379,7 @@ void TestJSONRPC::testGarbageData()
QSignalSpy spy(m_mockTcpServer, &MockTcpServer::connectionTerminated);
QByteArray data;
for (int i = 0; i < 1024; i++) {
for (int i = 0; i < 1024 * 1024; i++) {
data.append("a");
}
for (int i = 0; i < 11 && spy.count() == 0; i ++) {