diff --git a/include/ircd/resource/response.h b/include/ircd/resource/response.h index 60736b918..42114f807 100644 --- a/include/ircd/resource/response.h +++ b/include/ircd/resource/response.h @@ -72,7 +72,7 @@ struct ircd::resource::response /// something like json::stack, which streams chunks of JSON. To facilitate /// this type of pairing and real world use, instances of this object contain /// a simple buffered flush-callback system. -// +/// /// By default this object allocates a buffer to facilitate the chunked /// response and to satisfy the majority pattern of allocating this same /// buffer immediately preceding construction. A function pointer can also @@ -102,8 +102,9 @@ struct ircd::resource::response::chunked std::function 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 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 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; diff --git a/ircd/resource.cc b/ircd/resource.cc index 9e46e1bff..a680a9707 100644 --- a/ircd/resource.cc +++ b/ircd/resource.cc @@ -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, const http::code &code, const string_view &content_type,