From 601495fa0f3d3793d4ee761d1b86f8435417266c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 16 Jan 2013 22:55:33 +0100 Subject: ClientList: convert to a class --- src/Main.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/Main.cxx') diff --git a/src/Main.cxx b/src/Main.cxx index 917d8945..e70e5f90 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(); -- cgit v1.2.3