]> granicus.if.org Git - pdns/commitdiff
dnsdist: Manually raise an exception on EOF while reading the nonce
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 29 Mar 2018 08:55:56 +0000 (10:55 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 29 Mar 2018 08:55:56 +0000 (10:55 +0200)
regression-tests.dnsdist/dnsdisttests.py

index 4d5a83ca7569f70cb833537966e2499562bdee3f..62065709fa33602c6cfc4fafc91f2490b6d181f2 100644 (file)
@@ -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)