0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 16:22:35 +01:00

modules/federation/get_missing_events: No break on missing event; check path parc.

This commit is contained in:
Jason Volk 2018-06-02 19:47:11 -07:00
parent b79494adb9
commit 6356f62de2

View file

@ -64,6 +64,12 @@ resource::response
get__missing_events(client &client, get__missing_events(client &client,
const resource::request &request) const resource::request &request)
{ {
if(request.parv.size() < 1)
throw m::NEED_MORE_PARAMS
{
"room_id path parameter required"
};
m::room::id::buf room_id m::room::id::buf room_id
{ {
url::decode(request.parv[0], room_id) url::decode(request.parv[0], room_id)
@ -108,7 +114,7 @@ get__missing_events(client &client,
std::vector<std::string> ret; std::vector<std::string> ret;
ret.reserve(limit); ret.reserve(limit);
size_t goose{0}; size_t goose{0};
for(const auto &event_id : earliest) for(const auto &event_id : earliest) try
{ {
m::room::messages it m::room::messages it
{ {
@ -126,6 +132,16 @@ get__missing_events(client &client,
break; break;
} }
} }
catch(const std::exception &e)
{
log::derror
{
"Request from %s for earliest missing %s :%s",
string(remote(client)),
unquote(event_id),
e.what()
};
}
return resource::response return resource::response
{ {