diff options
author | Max Kellermann <max@duempel.org> | 2013-04-17 22:58:33 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-04-17 23:52:58 +0200 |
commit | b2d3d15e978aef2566a1bdae435d71cb326dec4d (patch) | |
tree | 769550ce5e624915b9d3129793624583474604ba /src/ClientNew.cxx | |
parent | 08dfd263ba496b0c1f6ddbe9b3eefa9a5cea57a4 (diff) | |
download | mpd-b2d3d15e978aef2566a1bdae435d71cb326dec4d.tar.gz mpd-b2d3d15e978aef2566a1bdae435d71cb326dec4d.tar.xz mpd-b2d3d15e978aef2566a1bdae435d71cb326dec4d.zip |
Main: move global variables to struct Instance
More preparations for multi-player support.
Diffstat (limited to 'src/ClientNew.cxx')
-rw-r--r-- | src/ClientNew.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ClientNew.cxx b/src/ClientNew.cxx index a416c1f83..22127c491 100644 --- a/src/ClientNew.cxx +++ b/src/ClientNew.cxx @@ -21,7 +21,7 @@ #include "ClientInternal.hxx" #include "ClientList.hxx" #include "Partition.hxx" -#include "Main.hxx" +#include "Instance.hxx" #include "fd_util.h" extern "C" { #include "resolver.h" @@ -95,7 +95,8 @@ client_new(EventLoop &loop, Partition &partition, } #endif /* HAVE_WRAP */ - if (client_list->IsFull()) { + ClientList &client_list = *partition.instance.client_list; + if (client_list.IsFull()) { g_warning("Max Connections Reached!"); close_socket(fd); return; @@ -106,7 +107,7 @@ client_new(EventLoop &loop, Partition &partition, (void)send(fd, GREETING, sizeof(GREETING) - 1, 0); - client_list->Add(*client); + client_list.Add(*client); remote = sockaddr_to_string(sa, sa_length, NULL); g_log(G_LOG_DOMAIN, LOG_LEVEL_SECURE, @@ -117,7 +118,7 @@ client_new(EventLoop &loop, Partition &partition, void Client::Close() { - client_list->Remove(*this); + partition.instance.client_list->Remove(*this); SetExpired(); |