summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/Client.cxx2
-rw-r--r--src/client/Client.hxx2
-rw-r--r--src/client/New.cxx2
3 files changed, 6 insertions, 0 deletions
diff --git a/src/client/Client.cxx b/src/client/Client.cxx
index 6c47a0822..21bc83cdb 100644
--- a/src/client/Client.cxx
+++ b/src/client/Client.cxx
@@ -68,7 +68,9 @@ Client::SetPartition(Partition &new_partition) noexcept
if (partition == &new_partition)
return;
+ partition->clients.erase(partition->clients.iterator_to(*this));
partition = &new_partition;
+ partition->clients.push_back(*this);
/* set idle flags for those subsystems which are specific to
the current partition to force the client to reload its
diff --git a/src/client/Client.hxx b/src/client/Client.hxx
index e52a7a18a..c94350b51 100644
--- a/src/client/Client.hxx
+++ b/src/client/Client.hxx
@@ -52,6 +52,8 @@ class BackgroundCommand;
class Client final
: FullyBufferedSocket,
+ public boost::intrusive::list_base_hook<boost::intrusive::tag<Partition>,
+ boost::intrusive::link_mode<boost::intrusive::normal_link>>,
public boost::intrusive::list_base_hook<boost::intrusive::link_mode<boost::intrusive::normal_link>> {
TimerEvent timeout_event;
diff --git a/src/client/New.cxx b/src/client/New.cxx
index b1affda4c..1f92c63c3 100644
--- a/src/client/New.cxx
+++ b/src/client/New.cxx
@@ -72,6 +72,7 @@ client_new(EventLoop &loop, Partition &partition,
num);
client_list.Add(*client);
+ partition.clients.push_back(*client);
FormatInfo(client_domain, "[%u] opened from %s",
num, remote.c_str());
@@ -81,6 +82,7 @@ void
Client::Close() noexcept
{
partition->instance.client_list->Remove(*this);
+ partition->clients.erase(partition->clients.iterator_to(*this));
if (FullyBufferedSocket::IsDefined())
FullyBufferedSocket::Close();