diff --git a/server/src/Configuration.cpp b/server/src/Configuration.cpp index d710208..25e537d 100644 --- a/server/src/Configuration.cpp +++ b/server/src/Configuration.cpp @@ -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> 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> 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(); } } diff --git a/server/src/Configuration.h b/server/src/Configuration.h index 7141fb5..3da3531 100644 --- a/server/src/Configuration.h +++ b/server/src/Configuration.h @@ -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 { diff --git a/server/src/client/ConnectedClientNotifyHandler.cpp b/server/src/client/ConnectedClientNotifyHandler.cpp index e4b1cf7..150fdc5 100644 --- a/server/src/client/ConnectedClientNotifyHandler.cpp +++ b/server/src/client/ConnectedClientNotifyHandler.cpp @@ -652,6 +652,15 @@ bool ConnectedClient::notifyClientEnterView(const std::shared_ptrserver->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(tp); auto seconds_since_epoch = std::chrono::system_clock::to_time_t(tp); ostringstream os; diff --git a/server/src/client/command_handler/channel.cpp b/server/src/client/command_handler/channel.cpp index 4426b4c..d4f6771 100644 --- a/server/src/client/command_handler/channel.cpp +++ b/server/src/client/command_handler/channel.cpp @@ -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); diff --git a/server/src/client/command_handler/groups.cpp b/server/src/client/command_handler/groups.cpp index bba4650..ea4947e 100644 --- a/server/src/client/command_handler/groups.cpp +++ b/server/src/client/command_handler/groups.cpp @@ -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) { diff --git a/server/src/server/GlobalNetworkEvents.cpp b/server/src/server/GlobalNetworkEvents.cpp index 4f4f36c..8eadc2e 100644 --- a/server/src/server/GlobalNetworkEvents.cpp +++ b/server/src/server/GlobalNetworkEvents.cpp @@ -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) { diff --git a/server/src/server/QueryServer.cpp b/server/src/server/QueryServer.cpp index 939b9fd..019c590 100644 --- a/server/src/server/QueryServer.cpp +++ b/server/src/server/QueryServer.cpp @@ -30,7 +30,6 @@ QueryServer::~QueryServer() { stop(); } - void QueryServer::unregisterConnection(const shared_ptr &client) { { lock_guard lock(this->connected_clients_mutex);