summaryrefslogtreecommitdiffstats
path: root/server/src/req_ctx.cppm
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/req_ctx.cppm')
-rw-r--r--server/src/req_ctx.cppm65
1 files changed, 31 insertions, 34 deletions
diff --git a/server/src/req_ctx.cppm b/server/src/req_ctx.cppm
index 797c51d..4a64d7d 100644
--- a/server/src/req_ctx.cppm
+++ b/server/src/req_ctx.cppm
@@ -10,42 +10,39 @@ import :trace;
10 10
11namespace routemon { 11namespace routemon {
12 12
13 export class req_ctx { 13export class req_ctx
14 trace::id tid_; 14{
15 std::locale locale_; 15 trace::id tid_;
16 http::verb_set route_verbs_; 16 std::locale locale_;
17 bool keep_alive_; 17 http::verb_set route_verbs_;
18 bhttp::request_header<bhttp::fields> const& req_header_; 18 bool keep_alive_;
19 bhttp::request_header<bhttp::fields> const& req_header_;
19 20
20 public: 21public:
21 explicit req_ctx(trace::id tid, std::locale locale, http::verb_set route_verbs, bool keep_alive, bhttp::request_header<bhttp::fields> const& req_header) 22 explicit req_ctx(
22 : tid_{tid}, locale_{locale}, route_verbs_{route_verbs}, keep_alive_{keep_alive}, req_header_{req_header} 23 trace::id tid, std::locale locale, http::verb_set route_verbs,
23 {} 24 bool keep_alive, bhttp::request_header<bhttp::fields> const& req_header)
25 : tid_{tid}, locale_{locale}, route_verbs_{route_verbs},
26 keep_alive_{keep_alive}, req_header_{req_header}
27 {
28 }
24 29
25 template<typename ReqBody> 30 template <typename ReqBody>
26 explicit req_ctx(trace::id tid, std::locale locale, http::verb_set route_verbs, bhttp::request<ReqBody> const& req) 31 explicit req_ctx(
27 : req_ctx{tid, locale, route_verbs, req.keep_alive(), req.base()} 32 trace::id tid, std::locale locale, http::verb_set route_verbs,
28 {} 33 bhttp::request<ReqBody> const& req)
34 : req_ctx{tid, locale, route_verbs, req.keep_alive(), req.base()}
35 {
36 }
29 37
30 auto trace_id() const -> trace::id { 38 auto trace_id() const -> trace::id { return tid_; }
31 return tid_; 39 auto locale() const -> std::locale { return locale_; }
32 } 40 auto route_verbs() const -> http::verb_set { return route_verbs_; }
33 41 auto keep_alive() const -> bool { return keep_alive_; }
34 auto locale() const -> std::locale { 42 auto req_header() const -> bhttp::request_header<bhttp::fields> const&
35 return locale_; 43 {
36 } 44 return req_header_;
37 45 }
38 auto route_verbs() const -> http::verb_set { 46};
39 return route_verbs_;
40 }
41
42 auto keep_alive() const -> bool {
43 return keep_alive_;
44 }
45
46 auto req_header() const -> bhttp::request_header<bhttp::fields> const& {
47 return req_header_;
48 }
49 };
50 47
51} // namespace routemon 48} // namespace routemon