From b2d3d15e978aef2566a1bdae435d71cb326dec4d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 17 Apr 2013 22:58:33 +0200 Subject: Main: move global variables to struct Instance More preparations for multi-player support. --- src/ClientNew.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/ClientNew.cxx') 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(); -- cgit v1.2.3