0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-28 14:58:20 +02:00

ircd::server: Add a canceled tag reaper.

This commit is contained in:
Jason Volk 2019-09-06 20:01:53 -07:00
parent 5ead261243
commit 844bf46a5c
2 changed files with 20 additions and 0 deletions

View file

@ -94,6 +94,7 @@ struct ircd::server::link
void cancel_uncommitted(std::exception_ptr);
void cancel_committed(std::exception_ptr);
void cancel_all(std::exception_ptr);
void cleanup_canceled();
void submit(request &);
// control panel

View file

@ -1737,10 +1737,29 @@ ircd::server::link::submit(request &request)
tag_count()
};
*/
cleanup_canceled();
if(ready())
wait_writable();
}
void
ircd::server::link::cleanup_canceled()
{
auto it(begin(queue));
while(it != end(queue))
{
auto &tag{*it};
if(tag.committed() || tag.request)
{
++it;
continue;
}
it = queue.erase(it);
}
}
void
ircd::server::link::cancel_all(std::exception_ptr eptr)
{