[svn] commit: r3065 - /branches/trac299/src/bin/xfrout/xfrout.py.in

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Sep 29 08:45:31 UTC 2010


Author: chenzhengzhang
Date: Wed Sep 29 08:45:31 2010
New Revision: 3065

Log:
add stop flag for request handling loop

Modified:
    branches/trac299/src/bin/xfrout/xfrout.py.in

Modified: branches/trac299/src/bin/xfrout/xfrout.py.in
==============================================================================
--- branches/trac299/src/bin/xfrout/xfrout.py.in (original)
+++ branches/trac299/src/bin/xfrout/xfrout.py.in Wed Sep 29 08:45:31 2010
@@ -57,6 +57,7 @@
 MAX_TRANSFERS_OUT = 10
 VERBOSE_MODE = False
 
+SESSION_RUNNABLE = True 
 XFROUT_MAX_MESSAGE_SIZE = 65535
 
 def get_rrset_len(rrset):
@@ -74,7 +75,9 @@
         BaseRequestHandler.__init__(self, request, client_address, server)
 
     def handle(self):
-        while True:
+        # Handle a request until shutdown or xfrout client is closed.
+        global SESSION_RUNNABLE 
+        while SESSION_RUNNABLE:
             fd = recv_fd(self.request.fileno())
             
             if fd < 0:
@@ -341,6 +344,8 @@
             return True 
 
     def shutdown(self):
+        global SESSION_RUNNABLE
+        SESSION_RUNNABLE = False
         ThreadingUnixStreamServer.shutdown(self)
         try:
             os.unlink(self._sock_file)




More information about the bind10-changes mailing list