mirror of
https://github.com/matrix-construct/construct
synced 2024-12-27 07:54:05 +01:00
ircd::http: Modernize the header vector string generator.
This commit is contained in:
parent
ab9e9d698b
commit
3b1cc75f10
1 changed files with 6 additions and 7 deletions
13
ircd/http.cc
13
ircd/http.cc
|
@ -750,13 +750,12 @@ ircd::http::parser::content_length(const string_view &str)
|
|||
std::string
|
||||
ircd::http::strung(const vector_view<const header> &headers)
|
||||
{
|
||||
std::string ret(serialized(headers), char{});
|
||||
window_buffer out{ret};
|
||||
write(out, headers);
|
||||
assert(out.consumed() <= ret.size());
|
||||
ret.resize(out.consumed());
|
||||
assert(out.consumed() == ret.size());
|
||||
return ret;
|
||||
return ircd::string(serialized(headers), [&]
|
||||
(window_buffer out)
|
||||
{
|
||||
write(out, headers);
|
||||
return out.consumed();
|
||||
});
|
||||
}
|
||||
|
||||
/// Indicates the buffer size required to write these headers. This size
|
||||
|
|
Loading…
Reference in a new issue