mirror of
https://github.com/tnodir/fort
synced 2024-11-15 09:45:44 +00:00
UI: ControlWorker: Increase max number of allowed args.
This commit is contained in:
parent
88db4e5cf8
commit
c9f2b8fd9e
@ -5,7 +5,7 @@
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr int commandMaxArgs = 7;
|
||||
constexpr int commandMaxArgs = 16;
|
||||
constexpr int commandArgMaxSize = 4 * 1024;
|
||||
constexpr quint32 dataMaxSize = 1 * 1024 * 1024;
|
||||
|
||||
@ -120,8 +120,7 @@ QByteArray ControlWorker::buildCommandData(Control::Command command, const QVari
|
||||
|
||||
bool ControlWorker::sendCommandData(const QByteArray &commandData)
|
||||
{
|
||||
if (commandData.isEmpty())
|
||||
return false;
|
||||
Q_ASSERT(!commandData.isEmpty());
|
||||
|
||||
const int bytesSent = socket()->write(commandData);
|
||||
if (bytesSent != commandData.size()) {
|
||||
@ -137,6 +136,10 @@ bool ControlWorker::sendCommandData(const QByteArray &commandData)
|
||||
bool ControlWorker::sendCommand(Control::Command command, const QVariantList &args)
|
||||
{
|
||||
const QByteArray buffer = buildCommandData(command, args);
|
||||
if (buffer.isEmpty()) {
|
||||
qWarning() << "Bad RPC command to send:" << command << args;
|
||||
return false;
|
||||
}
|
||||
|
||||
return sendCommandData(buffer);
|
||||
}
|
||||
@ -196,6 +199,8 @@ bool ControlWorker::readRequest()
|
||||
|
||||
clearRequest();
|
||||
|
||||
// qDebug() << "requestReady>" << id() << command << args;
|
||||
|
||||
emit requestReady(command, args);
|
||||
|
||||
return true;
|
||||
|
@ -211,7 +211,7 @@ void RpcManager::invokeOnClients(Control::Command cmd, const QVariantList &args)
|
||||
|
||||
const QByteArray buffer = ControlWorker::buildCommandData(cmd, args);
|
||||
if (buffer.isEmpty()) {
|
||||
qWarning() << "Bad RPC command:" << cmd << args;
|
||||
qWarning() << "Bad RPC command to invoke:" << cmd << args;
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user