0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 15:30:52 +01:00

ircd::server: Close link if the only commitment is a cancelled tag.

This commit is contained in:
Jason Volk 2018-05-02 12:33:08 -07:00
parent 695fb4c9b0
commit 1d0ae3855a

View file

@ -1351,6 +1351,17 @@ ircd::server::link::handle_writable_success()
continue;
}
if(tag.canceled() && tag.committed() && tag_committed() <= 1)
{
log.debug("link(%p) closing to interrupt canceled committed tag(%p) of %zu",
this,
&tag,
tag_count());
close();
break;
}
if(tag_committed() == 0)
wait_readable();
@ -1423,7 +1434,7 @@ ircd::server::link::process_write_next(const const_buffer &buffer)
void
ircd::server::link::wait_readable()
{
if(op_read || unlikely(op_fini))
if(op_read || op_fini)
return;
auto handler
@ -1527,6 +1538,17 @@ try
return false;
}
if(tag.canceled() && tag_committed() <= 1)
{
log.debug("link(%p) closing to interrupt canceled committed tag(%p) of %zu",
this,
&tag,
tag_count());
close();
return false;
}
bool done{false}; do
{
overrun = process_read_next(overrun, tag, done);