Client: add method GetInstance()

This commit is contained in:
Max Kellermann
2017-02-25 10:00:05 +01:00
parent 668724de4e
commit 05b8ddac4c
8 changed files with 33 additions and 21 deletions

View File

@@ -126,11 +126,11 @@ handle_listfiles(Client &client, Request args, Response &r)
case LocatedUri::Type::RELATIVE:
#ifdef ENABLE_DATABASE
if (client.partition.instance.storage != nullptr)
if (client.GetInstance().storage != nullptr)
/* if we have a storage instance, obtain a list of
files from it */
return handle_listfiles_storage(r,
*client.partition.instance.storage,
*client.GetInstance().storage,
uri);
/* fall back to entries from database if we have no storage */
@@ -295,11 +295,11 @@ handle_update(Client &client, Request args, Response &r, bool discard)
}
}
UpdateService *update = client.partition.instance.update;
UpdateService *update = client.GetInstance().update;
if (update != nullptr)
return handle_update(r, *update, path, discard);
Database *db = client.partition.instance.database;
Database *db = client.GetInstance().database;
if (db != nullptr)
return handle_update(r, *db, path, discard);
#else