client/BackgroundCommand: infrastructure for commands running in background

This commit is contained in:
Max Kellermann
2019-04-03 14:31:57 +02:00
parent 28fc1d555f
commit 9f1c23e217
11 changed files with 272 additions and 0 deletions
+4
View File
@@ -29,6 +29,9 @@
BufferedSocket::InputResult
Client::OnSocketInput(void *data, size_t length) noexcept
{
if (background_command)
return InputResult::PAUSE;
char *p = (char *)data;
char *newline = (char *)memchr(p, '\n', length);
if (newline == nullptr)
@@ -48,6 +51,7 @@ Client::OnSocketInput(void *data, size_t length) noexcept
switch (result) {
case CommandResult::OK:
case CommandResult::IDLE:
case CommandResult::BACKGROUND:
case CommandResult::ERROR:
break;