aboutsummaryrefslogtreecommitdiffstats
path: root/src/Main.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-16 22:55:33 +0100
committerMax Kellermann <max@duempel.org>2013-01-16 23:00:13 +0100
commit601495fa0f3d3793d4ee761d1b86f8435417266c (patch)
tree1284f0f0ac48668391063e5f45eba08d0b59c2ed /src/Main.cxx
parent1998633739b027b97ff89f92825512db91dca8f9 (diff)
downloadmpd-601495fa0f3d3793d4ee761d1b86f8435417266c.tar.gz
mpd-601495fa0f3d3793d4ee761d1b86f8435417266c.tar.xz
mpd-601495fa0f3d3793d4ee761d1b86f8435417266c.zip
ClientList: convert to a class
Diffstat (limited to '')
-rw-r--r--src/Main.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Main.cxx b/src/Main.cxx
index 917d89457..e70e5f908 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -31,8 +31,8 @@
#include "DatabaseSimple.hxx"
#include "Permission.hxx"
#include "Listen.hxx"
-#include "ClientIdle.hxx"
#include "Client.hxx"
+#include "ClientList.hxx"
#include "AllCommands.hxx"
#include "Partition.hxx"
#include "Volume.hxx"
@@ -99,6 +99,8 @@ enum {
GThread *main_task;
EventLoop *main_loop;
+ClientList *client_list;
+
Partition *global_partition;
static StateFile *state_file;
@@ -330,7 +332,7 @@ idle_event_emitted(void)
clients */
unsigned flags = idle_get();
if (flags != 0)
- client_manager_idle_add(flags);
+ client_list->IdleAdd(flags);
}
/**
@@ -401,6 +403,9 @@ int mpd_main(int argc, char *argv[])
main_task = g_thread_self();
main_loop = new EventLoop(EventLoop::Default());
+ const unsigned max_clients = config_get_positive(CONF_MAX_CONN, 10);
+ client_list = new ClientList(max_clients);
+
success = listen_global_init(&error);
if (!success) {
g_warning("%s", error->message);
@@ -532,8 +537,8 @@ int mpd_main(int argc, char *argv[])
pc_kill(&global_partition->pc);
finishZeroconf();
- client_manager_deinit();
listen_global_finish();
+ delete client_list;
start = clock();
DatabaseGlobalDeinit();