From a8a6113517ac2d451b9871bced671b317aca837c Mon Sep 17 00:00:00 2001 From: Paulchen-Panther Date: Mon, 12 Aug 2019 19:06:11 +0200 Subject: [PATCH] If the priority range of a proto / flatbuffer connection is not in the valid range (100 - 199) we will send an error message to the client as well as in the console output Signed-off-by: Paulchen-Panther --- libsrc/flatbufserver/FlatBufferClient.cpp | 2 +- libsrc/protoserver/ProtoClientConnection.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libsrc/flatbufserver/FlatBufferClient.cpp b/libsrc/flatbufserver/FlatBufferClient.cpp index 6ad88217..0444851f 100644 --- a/libsrc/flatbufserver/FlatBufferClient.cpp +++ b/libsrc/flatbufserver/FlatBufferClient.cpp @@ -123,7 +123,7 @@ void FlatBufferClient::handleRegisterCommand(const hyperionnet::Register *regReq { if (regReq->priority() < 100 || regReq->priority() >= 200) { - // Warning(_log, "Register request from client %s contains invalid priority %d. Valid rage is between 100 and 199.", QSTRING_CSTR(_clientAddress), regReq->priority()); + Error(_log, "Register request from client %s contains invalid priority %d. Valid priority for Flatbuffer connections is between 100 and 199.", QSTRING_CSTR(_clientAddress), regReq->priority()); sendErrorReply("The priority " + std::to_string(regReq->priority()) + " is not in the priority range between 100 and 199."); return; } diff --git a/libsrc/protoserver/ProtoClientConnection.cpp b/libsrc/protoserver/ProtoClientConnection.cpp index d7cd13b9..a433f471 100644 --- a/libsrc/protoserver/ProtoClientConnection.cpp +++ b/libsrc/protoserver/ProtoClientConnection.cpp @@ -126,7 +126,8 @@ void ProtoClientConnection::handleColorCommand(const proto::ColorRequest &messag if (priority < 100 || priority >= 200) { - sendErrorReply("The priority " + std::to_string(priority) + " is not in the priority range between 100 and 199."); + sendErrorReply("The priority " + std::to_string(priority) + " is not in the valid priority range between 100 and 199."); + Error(_log, "The priority %d is not in the proto-connection range between 100 and 199.", priority); return; } @@ -156,7 +157,8 @@ void ProtoClientConnection::handleImageCommand(const proto::ImageRequest &messag if (priority < 100 || priority >= 200) { - sendErrorReply("The priority " + std::to_string(priority) + " is not in the priority range between 100 and 199."); + sendErrorReply("The priority " + std::to_string(priority) + " is not in the valid priority range between 100 and 199."); + Error(_log, "The priority %d is not in the proto-connection range between 100 and 199.", priority); return; }