From d1b6c8bf1a86764df9f0ddb1a189d287547fa359 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Wed, 21 Aug 2019 14:27:26 +0200 Subject: [PATCH] fix bug that caused endless loops in I/O Intr records --- src/StreamCore.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/StreamCore.cc b/src/StreamCore.cc index 49c17fd..dfb5126 100644 --- a/src/StreamCore.cc +++ b/src/StreamCore.cc @@ -901,11 +901,10 @@ evalIn() debug("StreamCore::evalIn(%s): early input: %s\n", name(), inputBuffer.expand()()); expectedInput = readCallback(lastInputStatus, NULL, 0); - if (!expectedInput) - { - // no more input needed + if (expectedInput == 0) return true; - } + if (expectedInput == -1) // don't know how much + expectedInput = 0; } if (flags & AsyncMode) { @@ -1078,7 +1077,7 @@ readCallback(StreamIoStatus status, if (maxInput) return maxInput - inputBuffer.length(); else - return -1; + return -1; // We don't know for how much to wait } // try to parse what we got end = inputBuffer.length();