From 127d3d6a147a339cc077d967328c22fce45645f5 Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Sat, 9 Feb 2019 23:31:04 +0100 Subject: [PATCH] res.tryEnd returns [ok, hasResponded] --- src/HttpResponse.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/HttpResponse.h b/src/HttpResponse.h index f81ce52..7f57398 100644 --- a/src/HttpResponse.h +++ b/src/HttpResponse.h @@ -213,9 +213,10 @@ public: internalEnd(data, data.length(), false); } - /* Try and end the response. Returns true on success. Starts a timeout in some cases. */ - bool tryEnd(std::string_view data, int totalSize = 0) { - return internalEnd(data, totalSize, true); + /* Try and end the response. Returns [true, true] on success. + * Starts a timeout in some cases. Returns [ok, hasResponded] */ + std::pair tryEnd(std::string_view data, int totalSize = 0) { + return {internalEnd(data, totalSize, true), hasResponded()}; } /* Write parts of the response in chunking fashion. Starts timeout if failed. */