mirror of https://github.com/nymea/nymea.git
Increase the maximum allowed message size in JSONRPC
Turns out 10KB can be exceeded with scriptingpull/358/head
parent
ae6a548d68
commit
504b88eddd
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 ++) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue