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