mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 08:42:34 +01:00
modules/s_fetch: Fix request set insertion.
This commit is contained in:
parent
a931a7f631
commit
4a22071be3
1 changed files with 7 additions and 7 deletions
|
@ -64,13 +64,16 @@ ircd::m::fetch::submit(const m::event::id &event_id,
|
|||
requests.lower_bound(string_view(event_id))
|
||||
};
|
||||
|
||||
if(it == end(requests) || it->event_id != event_id) try
|
||||
if(it != end(requests) && it->event_id == event_id)
|
||||
{
|
||||
assert(it->room_id == room_id);
|
||||
return false;
|
||||
}
|
||||
else try
|
||||
{
|
||||
it = requests.emplace_hint(it, room_id, event_id, bufsz, std::forward<args>(a)...);
|
||||
auto &request(const_cast<fetch::request &>(*it));
|
||||
while(!start(request))
|
||||
request.origin = {};
|
||||
|
||||
while(!start(request)) request.origin = {};
|
||||
return true;
|
||||
}
|
||||
catch(const std::exception &e)
|
||||
|
@ -86,7 +89,4 @@ ircd::m::fetch::submit(const m::event::id &event_id,
|
|||
requests.erase(it);
|
||||
return false;
|
||||
};
|
||||
|
||||
assert(it->room_id == room_id);
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue