diff --git a/src/client/Client.cxx b/src/client/Client.cxx index 7b22bc350..3819c6584 100644 --- a/src/client/Client.cxx +++ b/src/client/Client.cxx @@ -28,19 +28,19 @@ const Domain client_domain("client"); Instance & Client::GetInstance() { - return partition.instance; + return partition->instance; } playlist & Client::GetPlaylist() { - return partition.playlist; + return partition->playlist; } PlayerControl & Client::GetPlayerControl() { - return partition.pc; + return partition->pc; } #ifdef ENABLE_DATABASE @@ -48,19 +48,19 @@ Client::GetPlayerControl() const Database * Client::GetDatabase() const { - return partition.instance.GetDatabase(); + return partition->instance.GetDatabase(); } const Database & Client::GetDatabaseOrThrow() const { - return partition.instance.GetDatabaseOrThrow(); + return partition->instance.GetDatabaseOrThrow(); } const Storage * Client::GetStorage() const { - return partition.instance.storage; + return partition->instance.storage; } #endif diff --git a/src/client/Client.hxx b/src/client/Client.hxx index e2d81d3ac..f526c8a93 100644 --- a/src/client/Client.hxx +++ b/src/client/Client.hxx @@ -50,7 +50,7 @@ class Storage; class Client final : FullyBufferedSocket, TimeoutMonitor, public boost::intrusive::list_base_hook> { - Partition &partition; + Partition *partition; public: unsigned permission; @@ -189,7 +189,7 @@ public: void AllowFile(Path path_fs) const; Partition &GetPartition() { - return partition; + return *partition; } gcc_pure diff --git a/src/client/ClientNew.cxx b/src/client/ClientNew.cxx index b4dd4292f..97a891e7a 100644 --- a/src/client/ClientNew.cxx +++ b/src/client/ClientNew.cxx @@ -45,7 +45,7 @@ Client::Client(EventLoop &_loop, Partition &_partition, int _fd, int _uid, int _num) :FullyBufferedSocket(_fd, _loop, 16384, client_max_output_buffer_size), TimeoutMonitor(_loop), - partition(_partition), + partition(&_partition), permission(getDefaultPermissions()), uid(_uid), num(_num), @@ -107,7 +107,7 @@ client_new(EventLoop &loop, Partition &partition, void Client::Close() { - partition.instance.client_list->Remove(*this); + partition->instance.client_list->Remove(*this); SetExpired(); diff --git a/src/client/ClientRead.cxx b/src/client/ClientRead.cxx index 8be4c60e5..552b312bf 100644 --- a/src/client/ClientRead.cxx +++ b/src/client/ClientRead.cxx @@ -52,7 +52,7 @@ Client::OnSocketInput(void *data, size_t length) break; case CommandResult::KILL: - partition.instance.Shutdown(); + partition->instance.Shutdown(); Close(); return InputResult::CLOSED; diff --git a/src/client/ClientSubscribe.cxx b/src/client/ClientSubscribe.cxx index 2dd58fe1e..dc7c31b44 100644 --- a/src/client/ClientSubscribe.cxx +++ b/src/client/ClientSubscribe.cxx @@ -41,7 +41,7 @@ Client::Subscribe(const char *channel) ++num_subscriptions; - partition.EmitIdle(IDLE_SUBSCRIPTION); + partition->EmitIdle(IDLE_SUBSCRIPTION); return Client::SubscribeResult::OK; } @@ -58,7 +58,7 @@ Client::Unsubscribe(const char *channel) subscriptions.erase(i); --num_subscriptions; - partition.EmitIdle(IDLE_SUBSCRIPTION); + partition->EmitIdle(IDLE_SUBSCRIPTION); assert((num_subscriptions == 0) == subscriptions.empty());