From bdfa6902be0affecd72dce93124719626b2ff2e1 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 29 Mar 2018 10:55:56 +0200 Subject: [PATCH] dnsdist: Manually raise an exception on EOF while reading the nonce --- regression-tests.dnsdist/dnsdisttests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/regression-tests.dnsdist/dnsdisttests.py b/regression-tests.dnsdist/dnsdisttests.py index 4d5a83ca7..62065709f 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) -- 2.49.0