mirror of
https://github.com/matrix-construct/construct
synced 2024-12-01 19:22:53 +01:00
ircd::server: Adjust discard error expectations.
This commit is contained in:
parent
c4b18438ce
commit
5648903998
1 changed files with 5 additions and 2 deletions
|
@ -1610,9 +1610,12 @@ ircd::server::link::discard_read()
|
|||
SSL_pending(socket->ssl.native_handle())
|
||||
};
|
||||
|
||||
if(discard <= 0)
|
||||
if(discard <= 0 && queue.empty())
|
||||
discard = available(*socket);
|
||||
|
||||
if(discard <= 0 && !queue.empty())
|
||||
discard = 1;
|
||||
|
||||
const size_t discarded
|
||||
{
|
||||
discard_any(*socket, size_t(discard))
|
||||
|
@ -1632,7 +1635,7 @@ ircd::server::link::discard_read()
|
|||
|
||||
// just in case so this doesn't get loopy with discarding zero with
|
||||
// an empty queue...
|
||||
if(unlikely(!discard || !discarded))
|
||||
if(unlikely(!discard && !discarded))
|
||||
throw assertive
|
||||
{
|
||||
"peer(%p) link(%p) socket(%p) queue is empty and nothing to discard.",
|
||||
|
|
Loading…
Reference in a new issue