mirror of
https://github.com/matrix-construct/construct
synced 2025-01-16 17:46:54 +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
11
ircd/http.cc
11
ircd/http.cc
|
@ -750,13 +750,12 @@ ircd::http::parser::content_length(const string_view &str)
|
||||||
std::string
|
std::string
|
||||||
ircd::http::strung(const vector_view<const header> &headers)
|
ircd::http::strung(const vector_view<const header> &headers)
|
||||||
{
|
{
|
||||||
std::string ret(serialized(headers), char{});
|
return ircd::string(serialized(headers), [&]
|
||||||
window_buffer out{ret};
|
(window_buffer out)
|
||||||
|
{
|
||||||
write(out, headers);
|
write(out, headers);
|
||||||
assert(out.consumed() <= ret.size());
|
return out.consumed();
|
||||||
ret.resize(out.consumed());
|
});
|
||||||
assert(out.consumed() == ret.size());
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Indicates the buffer size required to write these headers. This size
|
/// Indicates the buffer size required to write these headers. This size
|
||||||
|
|
Loading…
Reference in a new issue