[9.18] fix: test: 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.

Closes #4301

Backport of MR !9537

Merge branch 'backport-4301-check-read-value-in-ans4-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9546
This commit is contained in:
Mark Andrews 2024-09-24 09:53:15 +00:00
commit 4d573a2111

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;
}
}