From 7f2f855c4e775276651eec9896af93b09d1b2c8c Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 17 Mar 2018 23:20:15 -0700 Subject: [PATCH] ircd::server: Reinstall the read handler after discard. --- ircd/server.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ircd/server.cc b/ircd/server.cc index eb03b991f..21a3813f9 100644 --- a/ircd/server.cc +++ b/ircd/server.cc @@ -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...