command: pass Response object to command callbacks

This commit is contained in:
Max Kellermann
2015-08-13 12:48:31 +02:00
parent 7652a2986b
commit 86e036c393
25 changed files with 246 additions and 395 deletions

View File

@@ -168,10 +168,8 @@ print_storage_uri(Client &client, Response &r, const Storage &storage)
}
CommandResult
handle_listmounts(Client &client, gcc_unused Request args)
handle_listmounts(Client &client, gcc_unused Request args, Response &r)
{
Response r(client);
Storage *_composite = client.partition.instance.storage;
if (_composite == nullptr) {
r.Error(ACK_ERROR_NO_EXIST, "No database");
@@ -192,10 +190,8 @@ handle_listmounts(Client &client, gcc_unused Request args)
}
CommandResult
handle_mount(Client &client, Request args)
handle_mount(Client &client, Request args, Response &r)
{
Response r(client);
Storage *_composite = client.partition.instance.storage;
if (_composite == nullptr) {
r.Error(ACK_ERROR_NO_EXIST, "No database");
@@ -256,10 +252,8 @@ handle_mount(Client &client, Request args)
}
CommandResult
handle_unmount(Client &client, Request args)
handle_unmount(Client &client, Request args, Response &r)
{
Response r(client);
Storage *_composite = client.partition.instance.storage;
if (_composite == nullptr) {
r.Error(ACK_ERROR_NO_EXIST, "No database");