res.tryEnd returns [ok, hasResponded]

This commit is contained in:
Alex Hultman
2019-02-09 23:31:04 +01:00
parent 3a41bb8e34
commit 127d3d6a14
+4 -3
View File
@@ -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<bool, bool> 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. */