0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-16 06:51:08 +01:00

ircd::resource::response::chunked: Additional overload for buffer w/o headers; fix comment.

This commit is contained in:
Jason Volk 2023-02-05 18:59:00 -08:00
parent f54b31358a
commit 981006d831
2 changed files with 20 additions and 2 deletions

View file

@ -72,7 +72,7 @@ struct ircd::resource::response
/// something like json::stack, which streams chunks of JSON. To facilitate /// something like json::stack, which streams chunks of JSON. To facilitate
/// this type of pairing and real world use, instances of this object contain /// this type of pairing and real world use, instances of this object contain
/// a simple buffered flush-callback system. /// a simple buffered flush-callback system.
// ///
/// By default this object allocates a buffer to facilitate the chunked /// By default this object allocates a buffer to facilitate the chunked
/// response and to satisfy the majority pattern of allocating this same /// response and to satisfy the majority pattern of allocating this same
/// buffer immediately preceding construction. A function pointer can also /// buffer immediately preceding construction. A function pointer can also
@ -102,8 +102,9 @@ struct ircd::resource::response::chunked
std::function<const_buffer (const const_buffer &)> flusher(); std::function<const_buffer (const const_buffer &)> flusher();
chunked(client &, const http::code &, const string_view &content_type, const string_view &headers = {}, const size_t &buffer_size = default_buffer_size, const mutable_buffer & = {}); chunked(client &, const http::code &, const string_view &content_type, const string_view &headers, const size_t &buffer_size = default_buffer_size, const mutable_buffer & = {});
chunked(client &, const http::code &, const string_view &content_type, const vector_view<const http::header> &, const size_t &buffer_size = default_buffer_size, const mutable_buffer & = {}); chunked(client &, const http::code &, const string_view &content_type, const vector_view<const http::header> &, const size_t &buffer_size = default_buffer_size, const mutable_buffer & = {});
chunked(client &, const http::code &, const string_view &content_type, const size_t &buffer_size = default_buffer_size, const mutable_buffer & = {});
chunked(client &, const http::code &, const vector_view<const http::header> &, const size_t &buffer_size = default_buffer_size, const mutable_buffer & = {}); chunked(client &, const http::code &, const vector_view<const http::header> &, const size_t &buffer_size = default_buffer_size, const mutable_buffer & = {});
chunked(client &, const http::code &, const size_t &buffer_size = default_buffer_size, const mutable_buffer & = {}); chunked(client &, const http::code &, const size_t &buffer_size = default_buffer_size, const mutable_buffer & = {});
chunked() = default; chunked() = default;

View file

@ -852,6 +852,23 @@ ircd::resource::response::chunked::chunked(client &client,
{ {
} }
ircd::resource::response::chunked::chunked(client &client,
const http::code &code,
const string_view &content_type,
const size_t &buffer_size,
const mutable_buffer &buf)
:chunked
{
client,
code,
content_type,
string_view{}, // headers
buffer_size,
buf,
}
{
}
ircd::resource::response::chunked::chunked(client &client, ircd::resource::response::chunked::chunked(client &client,
const http::code &code, const http::code &code,
const string_view &content_type, const string_view &content_type,