0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

modules/s_fetch: Fix gc iteration conditions.

This commit is contained in:
Jason Volk 2019-04-12 03:36:03 -07:00
parent c14d67102a
commit 8e5c858697

View file

@ -371,7 +371,13 @@ try
return std::any_of(begin(requests), end(requests), []
(const request &r)
{
return r.finished == 0;
if(r.finished == 0)
return true;
if(r.finished && empty(r.buf))
return true;
return false;
});
});
@ -500,6 +506,7 @@ ircd::m::fetch::eval_handle()
{
assert(!complete.empty());
complete.pop_front();
dock.notify_all();
}};
const auto it
@ -550,11 +557,19 @@ try
}
catch(const std::exception &e)
{
auto &request
{
const_cast<fetch::request &>(*it)
};
if(!request.eptr)
request.eptr = std::current_exception();
log::error
{
log, "fetch eval %s in %s :%s",
string_view{it->event_id},
string_view{it->room_id},
string_view{request.event_id},
string_view{request.room_id},
e.what()
};
}