From: Remi Gacogne Date: Thu, 29 Mar 2018 08:55:56 +0000 (+0200) Subject: dnsdist: Manually raise an exception on EOF while reading the nonce X-Git-Tag: dnsdist-1.3.0~5^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bdfa6902be0affecd72dce93124719626b2ff2e1;p=thirdparty%2Fpdns.git dnsdist: Manually raise an exception on EOF while reading the nonce --- diff --git a/regression-tests.dnsdist/dnsdisttests.py b/regression-tests.dnsdist/dnsdisttests.py index 4d5a83ca75..62065709fa 100644 --- a/regression-tests.dnsdist/dnsdisttests.py +++ b/regression-tests.dnsdist/dnsdisttests.py @@ -436,6 +436,8 @@ class DNSDistTest(unittest.TestCase): theirNonce = sock.recv(len(ourNonce)) if len(theirNonce) != len(ourNonce): print("Received a nonce of size %d, expecting %d, console command will not be sent!" % (len(theirNonce), len(ourNonce))) + if len(theirNonce) == 0: + raise socket.error("Got EOF while reading a nonce of size %d, console command will not be sent!" % (len(ourNonce))) return None halfNonceSize = int(len(ourNonce) / 2)