From cfc3705ea4b53b30ad2022a7aa88aa752d85d2df Mon Sep 17 00:00:00 2001 From: ipknHama Date: Sun, 14 Sep 2014 08:18:09 +0900 Subject: update amalgamate --- amalgamate/crow_all.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'amalgamate/crow_all.h') diff --git a/amalgamate/crow_all.h b/amalgamate/crow_all.h index 9e40013..3381670 100644 --- a/amalgamate/crow_all.h +++ b/amalgamate/crow_all.h @@ -5396,6 +5396,18 @@ namespace crow ci_map headers; std::string body; + void* middleware_context{}; + + request() + : method(HTTPMethod::GET) + { + } + + request(HTTPMethod method, std::string url, ci_map headers, std::string body) + : method(method), url(std::move(url)), headers(std::move(headers)), body(std::move(body)) + { + } + void add_header(std::string key, std::string value) { headers.emplace(std::move(key), std::move(value)); @@ -5406,7 +5418,6 @@ namespace crow return crow::get_header_value(headers, key); } - void* middleware_context{}; }; } @@ -5655,11 +5666,12 @@ namespace crow { if (!completed_) { + completed_ = true; + if (complete_request_handler_) { complete_request_handler_(); } - completed_ = true; } } @@ -6648,7 +6660,6 @@ namespace crow bool middleware_call_helper(Container& middlewares, request& req, response& res, Context& ctx) { using parent_context_t = typename Context::template partial; - using current_context_t = typename Context::template partial; before_handler_call(std::get(middlewares), req, res, ctx, static_cast(ctx)); if (res.is_completed()) @@ -6682,7 +6693,6 @@ namespace crow typename std::enable_if<(N==0)>::type after_handlers_call_helper(Container& middlewares, Context& ctx, request& req, response& res) { using parent_context_t = typename Context::template partial; - using current_context_t = typename Context::template partial; using CurrentMW = typename std::tuple_element::type>::type; after_handler_call(std::get(middlewares), req, res, ctx, static_cast(ctx)); } @@ -6691,7 +6701,6 @@ namespace crow typename std::enable_if<(N>0)>::type after_handlers_call_helper(Container& middlewares, Context& ctx, request& req, response& res) { using parent_context_t = typename Context::template partial; - using current_context_t = typename Context::template partial; using CurrentMW = typename std::tuple_element::type>::type; after_handler_call(std::get(middlewares), req, res, ctx, static_cast(ctx)); after_handlers_call_helper(middlewares, ctx, req, res); -- cgit v1.2.3-54-g00ecf