diff options
-rw-r--r-- | src/Main.cxx | 2 | ||||
-rw-r--r-- | src/client/Client.hxx | 3 | ||||
-rw-r--r-- | src/client/ClientGlobal.cxx | 17 |
3 files changed, 12 insertions, 10 deletions
diff --git a/src/Main.cxx b/src/Main.cxx index e8758ef37..aec0597ba 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -576,7 +576,7 @@ try { partition.UpdateEffectiveReplayGainMode(); } - client_manager_init(); + client_manager_init(raw_config); input_stream_global_init(raw_config, instance->io_thread.GetEventLoop()); playlist_list_global_init(raw_config); diff --git a/src/client/Client.hxx b/src/client/Client.hxx index 07e51b969..457ea746b 100644 --- a/src/client/Client.hxx +++ b/src/client/Client.hxx @@ -37,6 +37,7 @@ #include <stddef.h> +struct ConfigData; class SocketAddress; class UniqueSocketDescriptor; class EventLoop; @@ -237,7 +238,7 @@ private: }; void -client_manager_init(); +client_manager_init(const ConfigData &config); void client_new(EventLoop &loop, Partition &partition, diff --git a/src/client/ClientGlobal.cxx b/src/client/ClientGlobal.cxx index d7180bd5c..59cbb144a 100644 --- a/src/client/ClientGlobal.cxx +++ b/src/client/ClientGlobal.cxx @@ -19,7 +19,7 @@ #include "config.h" #include "ClientInternal.hxx" -#include "config/Global.hxx" +#include "config/Data.hxx" #define CLIENT_TIMEOUT_DEFAULT (60) #define CLIENT_MAX_COMMAND_LIST_DEFAULT (2048*1024) @@ -29,19 +29,20 @@ std::chrono::steady_clock::duration client_timeout; size_t client_max_command_list_size; size_t client_max_output_buffer_size; -void client_manager_init(void) +void +client_manager_init(const ConfigData &config) { - unsigned client_timeout_s = config_get_positive(ConfigOption::CONN_TIMEOUT, - CLIENT_TIMEOUT_DEFAULT); + unsigned client_timeout_s = config.GetPositive(ConfigOption::CONN_TIMEOUT, + CLIENT_TIMEOUT_DEFAULT); client_timeout = std::chrono::seconds(client_timeout_s); client_max_command_list_size = - config_get_positive(ConfigOption::MAX_COMMAND_LIST_SIZE, - CLIENT_MAX_COMMAND_LIST_DEFAULT / 1024) + config.GetPositive(ConfigOption::MAX_COMMAND_LIST_SIZE, + CLIENT_MAX_COMMAND_LIST_DEFAULT / 1024) * 1024; client_max_output_buffer_size = - config_get_positive(ConfigOption::MAX_OUTPUT_BUFFER_SIZE, - CLIENT_MAX_OUTPUT_BUFFER_SIZE_DEFAULT / 1024) + config.GetPositive(ConfigOption::MAX_OUTPUT_BUFFER_SIZE, + CLIENT_MAX_OUTPUT_BUFFER_SIZE_DEFAULT / 1024) * 1024; } |