From fd2eafa7c67e0efdae7d3d18c39b97f724372f7e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 6 Nov 2013 22:01:06 +0100 Subject: ClientRead: "close" flushes the output buffer Add a new CommandResult code called "FINISH" which, unlike "CLOSE", will attempt to flush the output buffer. This is a one-shot attempt; it will do one write, and not try again. --- src/ClientRead.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/ClientRead.cxx') diff --git a/src/ClientRead.cxx b/src/ClientRead.cxx index 925e1502d..22edefe60 100644 --- a/src/ClientRead.cxx +++ b/src/ClientRead.cxx @@ -57,6 +57,11 @@ Client::OnSocketInput(void *data, size_t length) main_loop->Break(); return InputResult::CLOSED; + case CommandResult::FINISH: + if (Flush()) + Close(); + return InputResult::CLOSED; + case CommandResult::CLOSE: Close(); return InputResult::CLOSED; -- cgit v1.2.3