0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd::resource: Deinline request aggregate ctor.

This commit is contained in:
Jason Volk 2022-07-14 14:18:02 -07:00
parent 378b9b3acf
commit 24cf3569a9
2 changed files with 43 additions and 18 deletions

View file

@ -23,14 +23,7 @@ struct ircd::resource::request
vector_view<string_view> parv;
string_view param[8];
request(const http::request::head &head,
const string_view &content)
:json::object{content}
,head{head}
,content{content}
,query{this->head.query}
{}
request(const http::request::head &, const string_view &content) noexcept;
request() = default;
};
@ -46,14 +39,19 @@ struct ircd::resource::request::object
const vector_view<string_view> &parv;
const json::object &body;
object(resource::request &r)
:tuple{r}
,r{r}
,head{r.head}
,content{r.content}
,query{r.query}
,params{r.params}
,parv{r.parv}
,body{r}
{}
object(resource::request &) noexcept;
};
template<class tuple>
inline
ircd::resource::request::object<tuple>::object(resource::request &r)
noexcept
:tuple{r}
,r{r}
,head{r.head}
,content{r.content}
,query{r.query}
,params{r.params}
,parv{r.parv}
,body{r}
{}

View file

@ -738,6 +738,33 @@ const
return head.content_length <= payload_max;
}
///////////////////////////////////////////////////////////////////////////////
//
// resource/request.h
//
ircd::resource::request::request(const http::request::head &head,
const string_view &content)
noexcept
:json::object
{
content
}
,head
{
head
}
,content
{
content
}
,query
{
this->head.query
}
{
}
///////////////////////////////////////////////////////////////////////////////
//
// resource/response.h