protocol/Result: convert to Client method
This commit is contained in:
@@ -154,6 +154,10 @@ public:
|
||||
return Write(s.data(), s.size());
|
||||
}
|
||||
|
||||
bool WriteOK() noexcept {
|
||||
return Write("OK\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the uid of the client process, or a negative value
|
||||
* if the uid is unknown
|
||||
|
@@ -20,7 +20,6 @@
|
||||
#include "Client.hxx"
|
||||
#include "Config.hxx"
|
||||
#include "Domain.hxx"
|
||||
#include "protocol/Result.hxx"
|
||||
#include "command/AllCommands.hxx"
|
||||
#include "Log.hxx"
|
||||
#include "util/StringAPI.hxx"
|
||||
@@ -72,7 +71,7 @@ Client::ProcessLine(char *line) noexcept
|
||||
if (idle_waiting) {
|
||||
/* send empty idle response and leave idle mode */
|
||||
idle_waiting = false;
|
||||
command_success(*this);
|
||||
WriteOK();
|
||||
}
|
||||
|
||||
/* do nothing if the client wasn't idling: the client
|
||||
@@ -108,7 +107,7 @@ Client::ProcessLine(char *line) noexcept
|
||||
"list returned {}", id, unsigned(ret));
|
||||
|
||||
if (ret == CommandResult::OK)
|
||||
command_success(*this);
|
||||
WriteOK();
|
||||
|
||||
return ret;
|
||||
} else {
|
||||
@@ -144,7 +143,7 @@ Client::ProcessLine(char *line) noexcept
|
||||
return CommandResult::CLOSE;
|
||||
|
||||
if (ret == CommandResult::OK)
|
||||
command_success(*this);
|
||||
WriteOK();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@@ -21,7 +21,6 @@
|
||||
#include "Client.hxx"
|
||||
#include "Response.hxx"
|
||||
#include "command/CommandError.hxx"
|
||||
#include "protocol/Result.hxx"
|
||||
|
||||
ThreadBackgroundCommand::ThreadBackgroundCommand(Client &_client) noexcept
|
||||
:thread(BIND_THIS_METHOD(_Run)),
|
||||
@@ -57,7 +56,7 @@ ThreadBackgroundCommand::DeferredFinish() noexcept
|
||||
PrintError(response, error);
|
||||
} else {
|
||||
SendResponse(response);
|
||||
command_success(client);
|
||||
client.WriteOK();
|
||||
}
|
||||
|
||||
/* delete this object */
|
||||
|
Reference in New Issue
Block a user