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

ircd:Ⓜ️:fed: Fix content/uri buffer reuse.

This commit is contained in:
Jason Volk 2020-10-03 02:27:41 -07:00
parent bfaf21807b
commit f03db0115f

View file

@ -308,7 +308,7 @@ ircd::m::fed::frontfill::frontfill(const room::id &room_id,
if(likely(!defined(json::get<"method"_>(opts.request))))
json::get<"method"_>(opts.request) = "POST";
window_buffer buf{buf_};
mutable_buffer buf{buf_};
if(likely(!defined(json::get<"uri"_>(opts.request))))
{
thread_local char ridbuf[768];
@ -323,15 +323,12 @@ ircd::m::fed::frontfill::frontfill(const room::id &room_id,
if(likely(!defined(json::get<"content"_>(opts.request))))
{
buf([&pair, &opts](const mutable_buffer &buf)
{
return make_content(buf, pair, opts);
});
json::get<"content"_>(opts.request) = json::object
{
buf.completed()
make_content(buf, pair, opts)
};
consume(buf, size(string_view(json::get<"content"_>(opts.request))));
}
return request