mirror of
https://github.com/matrix-construct/construct
synced 2024-11-16 23:10:54 +01:00
modules/federation/backfill_ids: Chunk direct to socket.
This commit is contained in:
parent
7e96e00184
commit
87f792b8eb
1 changed files with 27 additions and 25 deletions
|
@ -85,14 +85,23 @@ get__backfill_ids(client &client,
|
||||||
room_id, event_id
|
room_id, event_id
|
||||||
};
|
};
|
||||||
|
|
||||||
//TODO: chunk direct to socket
|
|
||||||
const unique_buffer<mutable_buffer> buf
|
const unique_buffer<mutable_buffer> buf
|
||||||
{
|
{
|
||||||
512 * limit //TODO: XXX
|
4_KiB
|
||||||
};
|
};
|
||||||
|
|
||||||
json::stack out{buf};
|
resource::response::chunked response
|
||||||
{
|
{
|
||||||
|
client, http::OK
|
||||||
|
};
|
||||||
|
|
||||||
|
json::stack out{buf, [&response]
|
||||||
|
(const const_buffer &buf)
|
||||||
|
{
|
||||||
|
response.write(buf);
|
||||||
|
return buf;
|
||||||
|
}};
|
||||||
|
|
||||||
json::stack::object top{out};
|
json::stack::object top{out};
|
||||||
json::stack::member pdus_m
|
json::stack::member pdus_m
|
||||||
{
|
{
|
||||||
|
@ -107,15 +116,8 @@ get__backfill_ids(client &client,
|
||||||
size_t count{0};
|
size_t count{0};
|
||||||
for(; it && count < limit; ++count, --it)
|
for(; it && count < limit; ++count, --it)
|
||||||
pdus.append(it.event_id());
|
pdus.append(it.event_id());
|
||||||
}
|
|
||||||
|
|
||||||
return resource::response
|
return {};
|
||||||
{
|
|
||||||
client, json::object
|
|
||||||
{
|
|
||||||
out.completed()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
resource::method
|
resource::method
|
||||||
|
|
Loading…
Reference in a new issue