]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check read value in upforwd/ans4
authorMark Andrews <marka@isc.org>
Mon, 23 Sep 2024 04:56:54 +0000 (14:56 +1000)
committerMark Andrews <marka@isc.org>
Tue, 24 Sep 2024 05:33:06 +0000 (05:33 +0000)
The ans4 server wasn't shutting down cleanly sometimes.  Check that
read returns the expected value for the message length or exit read
loop.

bin/tests/system/upforwd/ans4/ans.pl

index 000be5636ca24ce2ef2e26f85de6d9ae64806ba4..20392a4c1154711fd3284e4a23655e9ae2bbdf0c 100644 (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;
        }
 }