0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-15 14:31:11 +01:00

ircd:Ⓜ️:fetch: Add remote hinting to fetch::opts.

This commit is contained in:
Jason Volk 2019-08-29 19:28:37 -07:00
parent ac573cd21d
commit 9b23b4d907
2 changed files with 8 additions and 0 deletions

View file

@ -89,6 +89,11 @@ struct ircd::m::fetch::opts
/// where 16_KiB is [current server default] for headers and 64_KiB is /// where 16_KiB is [current server default] for headers and 64_KiB is
/// m::event::MAX_SIZE. /// m::event::MAX_SIZE.
size_t bufsz {0}; size_t bufsz {0};
/// Name of a remote server which will be queried first; if failure,
/// the normal room_id based operation is the fallback. If the room
/// is not known to us, it would be best to set this.
string_view hint;
}; };
struct ircd::m::fetch::result struct ircd::m::fetch::result

View file

@ -390,6 +390,9 @@ bool
ircd::m::fetch::start(request &request) try ircd::m::fetch::start(request &request) try
{ {
assert(!request.finished); assert(!request.finished);
if(!request.started && !request.origin)
request.origin = request.opts.hint;
if(!request.started) if(!request.started)
request.started = ircd::now<system_point>(); request.started = ircd::now<system_point>();