aboutsummaryrefslogtreecommitdiffstats
path: root/include/http_response.h
diff options
context:
space:
mode:
authoripknHama <ipknhama@gmail.com>2014-09-07 04:30:53 +0900
committeripknHama <ipknhama@gmail.com>2014-09-07 04:30:53 +0900
commit2748e35430b9a4aaf64dfbd626d819f0fc5eedd2 (patch)
treea8ebd5648d46cc7073b2ae6f6b5ada0e702c456c /include/http_response.h
parentc89cafa820ec02f041c3b0e52877bc321f6a1ba9 (diff)
downloadcrow-2748e35430b9a4aaf64dfbd626d819f0fc5eedd2.tar.gz
crow-2748e35430b9a4aaf64dfbd626d819f0fc5eedd2.zip
basic middleware test: before_handler
Diffstat (limited to 'include/http_response.h')
-rw-r--r--include/http_response.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/http_response.h b/include/http_response.h
index ae92543..bc468b7 100644
--- a/include/http_response.h
+++ b/include/http_response.h
@@ -5,11 +5,11 @@
namespace crow
{
- template <typename T>
+ template <typename Handler, typename ... Middlewares>
class Connection;
struct response
{
- template <typename T>
+ template <typename Handler, typename ... Middlewares>
friend class crow::Connection;
std::string body;
@@ -31,7 +31,7 @@ namespace crow
response& operator = (const response& r) = delete;
- response& operator = (response&& r)
+ response& operator = (response&& r) noexcept
{
body = std::move(r.body);
json_value = std::move(r.json_value);
@@ -41,6 +41,11 @@ namespace crow
return *this;
}
+ bool is_completed() const noexcept
+ {
+ return completed_;
+ }
+
void clear()
{
body.clear();
@@ -59,11 +64,11 @@ namespace crow
{
if (!completed_)
{
- completed_ = true;
if (complete_request_handler_)
{
complete_request_handler_();
}
+ completed_ = true;
}
}