Fixed query disconnect and log message

This commit is contained in:
WolverinDEV 2021-01-31 18:51:07 +01:00
parent bb3cc465d7
commit e2335becd7
2 changed files with 1 additions and 2 deletions

View File

@ -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;

View File

@ -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;