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

ircd::server: Reinstall the read handler after discard.

This commit is contained in:
Jason Volk 2018-03-17 23:20:15 -07:00
parent f5fa5100de
commit 7f2f855c4e

View file

@ -1435,7 +1435,11 @@ void
ircd::server::link::handle_readable_success()
{
if(queue.empty())
return discard_read();
{
discard_read();
wait_readable();
return;
}
// Data pointed to by overrun will remain intact between iterations
// because this loop isn't executing in any ircd::ctx.
@ -1567,8 +1571,8 @@ ircd::server::link::discard_read()
// the pending error like an eof.
log.warning("Link to %s discarded %zu of %zu unexpected bytes",
likely(peer)? string(peer->remote) : string(remote_ipport(*socket)),
discard,
discarded);
discarded,
discard);
// just in case so this doesn't get loopy with discarding zero with
// an empty queue...