Merge PR #358: Increase the maximum allowed message size in JSONRPC

This commit is contained in:
Jenkins nymea 2020-12-21 18:00:52 +01:00
commit 8a2d9c7e95
2 changed files with 3 additions and 3 deletions

View File

@ -623,8 +623,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 ++) {