Check read value in upforwd/ans4

The ans4 server wasn't shutting down cleanly sometimes.  Check that
read returns the expected value for the message length or exit read
loop.

(cherry picked from commit 21baad0a8f)
This commit is contained in:
Mark Andrews 2024-09-23 14:56:54 +10:00
parent 5afcb291a3
commit a0522653ca

View file

@ -357,7 +357,9 @@ for (;;) {
last unless $n == 2;
my $len = unpack("n", $lenbuf);
$n = $conn->sysread($buf, $len);
last unless $n == $len;
}
sleep(1);
$conn->close;
}
}