Some minor compile warning fixing

This commit is contained in:
WolverinDEV 2021-04-15 19:14:21 +02:00
parent 63eccff578
commit 9428c411ae
8 changed files with 34 additions and 54 deletions

View File

@ -124,13 +124,8 @@ size_t config::threads::ticking;
size_t config::threads::command_execute;
size_t config::threads::network_events;
size_t config::threads::voice::events_per_server;
size_t config::threads::voice::io_min;
size_t config::threads::voice::io_per_server;
size_t config::threads::voice::io_limit;
bool config::threads::voice::bind_io_thread_to_kernel_thread;
size_t config::threads::music::execute_limit;
size_t config::threads::music::execute_per_bot;
size_t config::threads::web::io_loops;
std::string config::messages::teamspeak_permission_editor;
bool config::web::activated;
@ -1824,12 +1819,6 @@ std::deque<std::shared_ptr<EntryBinding>> config::create_bindings() {
ADD_SENSITIVE();
}
}
{
CREATE_BINDING("web.io_loops", 0);
BIND_INTEGRAL(config::threads::web::io_loops, 2, 1, 128);
ADD_DESCRIPTION("Thread pool size for the ticking task of a VirtualServer");
ADD_SENSITIVE();
}
{
CREATE_BINDING("command_execute", 0);
BIND_INTEGRAL(config::threads::command_execute, 4, 1, 128);
@ -1846,32 +1835,9 @@ std::deque<std::shared_ptr<EntryBinding>> config::create_bindings() {
BIND_GROUP(voice)
{
CREATE_BINDING("events_per_server", 0);
BIND_INTEGRAL(config::threads::voice::events_per_server, 2, 1, 16);
ADD_DESCRIPTION("Kernel events per server");
ADD_SENSITIVE();
}
{
CREATE_BINDING("io_min", 0);
BIND_INTEGRAL(config::threads::voice::io_min, 2, 1, 1024);
ADD_DESCRIPTION("Minimum IO threads");
ADD_SENSITIVE();
}
{
CREATE_BINDING("io_per_server", 0);
BIND_INTEGRAL(config::threads::voice::io_per_server, 2, 1, 64);
ADD_DESCRIPTION("IO Thread increase per server");
ADD_SENSITIVE();
}
{
CREATE_BINDING("io_limit", 0);
BIND_INTEGRAL(config::threads::voice::io_limit, 5, 1, 1024);
ADD_DESCRIPTION("Max IO threads");
ADD_SENSITIVE();
}
{
CREATE_BINDING("bind_io_thread_to_kernel_thread", 0);
BIND_BOOL(config::threads::voice::bind_io_thread_to_kernel_thread, false);
ADD_DESCRIPTION("Bind each IO thread to one kernel thread to improve socket IO performance");
BIND_INTEGRAL(config::threads::voice::events_per_server, 4, 1, 128);
ADD_DESCRIPTION("Kernel events per server socket");
ADD_DESCRIPTION("This value is upper bound to threads.network_events and should not exceed it.");
ADD_SENSITIVE();
}
}

View File

@ -229,27 +229,18 @@ namespace ts::config {
}
namespace threads {
extern size_t ticking; /* in use */
extern size_t command_execute; /* in use */
extern size_t network_events; /* in use */
extern size_t ticking;
extern size_t command_execute;
extern size_t network_events;
namespace voice {
extern size_t events_per_server; /* in use */
extern size_t io_min;
extern size_t io_per_server;
extern size_t io_limit;
extern bool bind_io_thread_to_kernel_thread;
extern size_t events_per_server;
}
namespace music {
extern size_t execute_per_bot;
extern size_t execute_limit;
}
namespace web {
extern size_t io_loops;
}
}
namespace log {

View File

@ -652,6 +652,15 @@ bool ConnectedClient::notifyClientEnterView(const std::shared_ptr<ConnectedClien
;//invoker = this->server->serverRoot.get();
}
break;
case ViewReasonId::VREASON_SYSTEM:
case ViewReasonId::VREASON_TIMEOUT:
case ViewReasonId::VREASON_SERVER_STOPPED:
case ViewReasonId::VREASON_SERVER_LEFT:
case ViewReasonId::VREASON_CHANNEL_UPDATED:
case ViewReasonId::VREASON_EDITED:
case ViewReasonId::VREASON_SERVER_SHUTDOWN:
case ViewReasonId::VREASON_USER_ACTION:
default:
break;
}
@ -669,6 +678,15 @@ bool ConnectedClient::notifyClientEnterView(const std::shared_ptr<ConnectedClien
case ViewReasonId::VREASON_SERVER_KICK:
builder.put_unchecked(0, "reasonmsg", reason);
break;
case ViewReasonId::VREASON_SYSTEM:
case ViewReasonId::VREASON_TIMEOUT:
case ViewReasonId::VREASON_SERVER_STOPPED:
case ViewReasonId::VREASON_SERVER_LEFT:
case ViewReasonId::VREASON_CHANNEL_UPDATED:
case ViewReasonId::VREASON_EDITED:
case ViewReasonId::VREASON_SERVER_SHUTDOWN:
case ViewReasonId::VREASON_USER_ACTION:
default:
break;
}

View File

@ -754,8 +754,6 @@ bool ConnectedClient::handle_text_command(
}
auto time_str = [](const system_clock::time_point& tp) {
using system_clock_duration = std::chrono::system_clock::duration;
auto converted_timep = std::chrono::time_point_cast<system_clock_duration>(tp);
auto seconds_since_epoch = std::chrono::system_clock::to_time_t(tp);
ostringstream os;

View File

@ -622,6 +622,10 @@ command_result ConnectedClient::handleCommandChannelCreate(Command &cmd) {
case ChannelType::temporary:
log_channel_type = log::ChannelType::TEMPORARY;
break;
default:
assert(false);
return ts::command_result{error::vs_critical};
}
serverInstance->action_logger()->channel_logger.log_channel_create(this->getServerId(), this->ref(), created_channel->channelId(), log_channel_type);

View File

@ -280,6 +280,9 @@ command_result ConnectedClient::handleCommandGroupCopy(Command &cmd, GroupTarget
case GroupTarget::GROUPTARGET_CHANNEL:
result = group_manager->channel_groups()->copy_group_permissions(source_group_id, target_group_id);
break;
default:
return command_result{error::vs_critical};
}
switch(result) {

View File

@ -69,7 +69,7 @@ event* NetworkEventLoop::allocate_event(int fd, short events, event_callback_fn
}
std::lock_guard lock{this->mutex};
EventLoop* event_loop;
EventLoop* event_loop{nullptr};
size_t try_count{0};
while(try_count++ < this->event_loops.size()) {
@ -91,6 +91,7 @@ event* NetworkEventLoop::allocate_event(int fd, short events, event_callback_fn
/* We've no event loop to put the event in */
return nullptr;
}
assert(event_loop);
auto event = event_new(event_loop->event_base, fd, events, callback, callback_data);
if(!event) {

View File

@ -30,7 +30,6 @@ QueryServer::~QueryServer() {
stop();
}
void QueryServer::unregisterConnection(const shared_ptr<QueryClient> &client) {
{
lock_guard lock(this->connected_clients_mutex);