fix issue when receiving partial lines

This commit is contained in:
2024-09-30 15:19:53 +02:00
parent 59dabc3565
commit 75cac1c93b

View File

@@ -463,15 +463,13 @@ function main() {
# received complete line from stdin
line=$buf
elif (( rc > 128 )); then
# read timed out, check for partial data
if [ -n "$buf" ]; then
echo "< $buf (partial line)" >&$DEBUGLOG
line=$buf
# read the rest of the line
read -r -u $STDIN buf || exit 255
line+=$buf
fi
continue
# read timed out, continue if no partial data received
[ -z "$buf" ] && continue
echo "< $buf (partial line)" >&$DEBUGLOG
line=$buf
# read the rest of the line
read -r -u $STDIN buf || exit 255
line+=$buf
else
exit 255
fi