Commit 49382738 authored by Likun Zhang's avatar Likun Zhang
Browse files

Read the data in the readable socket of socketpair.

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac335@3245 e5f2f494-b856-4b98-b285-d166d9295462
parent 64d8257b
......@@ -44,6 +44,7 @@ _BAD_OPCODE = 3
_BAD_QR = 4
_BAD_REPLY_PACKET = 5
SOCK_DATA = b'somedata'
def addr_to_str(addr):
return '%s#%s' % (addr[0], addr[1])
......@@ -206,7 +207,7 @@ class NotifyOut:
# Ask it to stop
self._serving = False
self._write_sock.send(b'shutdown') # make self._read_sock be readable.
self._write_sock.send(SOCK_DATA) # make self._read_sock be readable.
# Wait for it
self._thread.join()
......@@ -304,7 +305,8 @@ class NotifyOut:
if err.args[0] != EINTR:
return {}, {}
if self._read_sock in r_fds:
if (self._read_sock in r_fds) and \
(self._read_sock.recv(len(SOCK_DATA)) == SOCK_DATA):
return {}, {} # user has called shutdown()
not_replied_zones = {}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment