0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-29 00:03:45 +02:00

ircd:Ⓜ️:fetch: Throw on loop break to properly set request.eptr and finish().

This commit is contained in:
Jason Volk 2019-09-16 12:36:38 -07:00
parent c7de8aec82
commit e73ebfd151

View file

@ -425,9 +425,13 @@ try
break;
}
assert(!request.finished);
finish(request);
return false;
throw m::NOT_FOUND
{
"Cannot find any server to fetch %s in %s in %zu attempts",
string_view{request.opts.event_id},
string_view{request.opts.room_id},
request.attempted.size(),
};
}
catch(...)
{
@ -592,14 +596,7 @@ ircd::m::fetch::select_random_origin(request &request)
}};
request.origin = {};
if(!origins.random(closure, proffer) || !request.origin)
throw m::NOT_FOUND
{
"Cannot find any server to fetch %s in %s",
string_view{request.opts.event_id},
string_view{request.opts.room_id},
};
origins.random(closure, proffer);
return request.origin;
}