0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd: Disambiguate the litany of response argument variations.

This commit is contained in:
Jason Volk 2018-03-09 13:15:32 -08:00
parent e4a4526b0c
commit e2569b4cb6
4 changed files with 7 additions and 7 deletions

View file

@ -131,7 +131,7 @@ struct ircd::resource::request::object
struct ircd::resource::response
{
response(client &, const size_t &content_length, const string_view &content_type, const http::code & = http::OK, const string_view &headers = {});
response(client &, const http::code &, const string_view &content_type, const size_t &content_length, const string_view &headers = {});
response(client &, const string_view &str, const string_view &content_type, const http::code &, const vector_view<const http::header> &);
response(client &, const string_view &str, const string_view &content_type, const http::code & = http::OK, const string_view &headers = {});
response(client &, const json::object &str, const http::code & = http::OK);

View file

@ -641,7 +641,7 @@ catch(const boost::system::system_error &e)
resource::response
{
*this, 0L, {}, http::REQUEST_TIMEOUT
*this, http::REQUEST_TIMEOUT, {}, 0L, {}
};
return false;

View file

@ -616,7 +616,7 @@ ircd::resource::response::response(client &client,
http::write(sb, headers);
}
new (this) response
response
{
client, content, content_type, code, string_view{sb.completed()}
};
@ -633,7 +633,7 @@ ircd::resource::response::response(client &client,
// Head gets sent
response
{
client, content.size(), content_type, code, headers
client, code, content_type, size(content), headers
};
// All content gets sent
@ -646,9 +646,9 @@ ircd::resource::response::response(client &client,
}
ircd::resource::response::response(client &client,
const size_t &content_length,
const string_view &content_type,
const http::code &code,
const string_view &content_type,
const size_t &content_length,
const string_view &headers)
{
assert(!content_length || !empty(content_type));

View file

@ -311,7 +311,7 @@ get__thumbnail_local(client &client,
// Send HTTP head to client
resource::response
{
client, file_size, content_type, http::OK
client, http::OK, content_type, file_size
};
const auto lpath{fs::make_path({fs::DPATH, "media"})};