From e2335becd7221b5011066489327c95d1af61bc2a Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sun, 31 Jan 2021 18:51:07 +0100 Subject: [PATCH] Fixed query disconnect and log message --- server/src/client/query/QueryClient.cpp | 1 - server/src/client/query/QueryClientCommands.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/server/src/client/query/QueryClient.cpp b/server/src/client/query/QueryClient.cpp index 715129f..756d11d 100644 --- a/server/src/client/query/QueryClient.cpp +++ b/server/src/client/query/QueryClient.cpp @@ -501,7 +501,6 @@ void QueryClient::handle_decoded_message(const std::string_view &message) { } std::string_view command_view{this->line_buffer + command_start_index, command_end_index - command_start_index}; - logTrace(0, "Found command: '{}'", command_view); this->command_queue->enqueue_command_string(command_view); command_start_index = command_start_next; diff --git a/server/src/client/query/QueryClientCommands.cpp b/server/src/client/query/QueryClientCommands.cpp index 7f7a08d..91dd58f 100644 --- a/server/src/client/query/QueryClientCommands.cpp +++ b/server/src/client/query/QueryClientCommands.cpp @@ -29,7 +29,7 @@ bool QueryClientCommandHandler::handle_command(const std::string_view &command) return false; } - if(command.empty()) { + if(command.empty() || command.find_first_not_of(' ') == std::string::npos) { logTrace(LOG_QUERY, "[{}:{}] Got query idle command.", client->getLoggingPeerIp(), client->getPeerPort()); client->resetIdleTime(); return true;