[svn] commit: r3462 - in /branches/trac299/src: bin/xfrout/tests/xfrout_test.py bin/xfrout/xfrout.py.in lib/xfr/fd_share.h lib/xfr/fdshare_python.cc

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Nov 5 10:24:07 UTC 2010


Author: chenzhengzhang
Date: Fri Nov  5 10:24:07 2010
New Revision: 3462

Log:
minor fix: code style 

Modified:
    branches/trac299/src/bin/xfrout/tests/xfrout_test.py
    branches/trac299/src/bin/xfrout/xfrout.py.in
    branches/trac299/src/lib/xfr/fd_share.h
    branches/trac299/src/lib/xfr/fdshare_python.cc

Modified: branches/trac299/src/bin/xfrout/tests/xfrout_test.py
==============================================================================
--- branches/trac299/src/bin/xfrout/tests/xfrout_test.py (original)
+++ branches/trac299/src/bin/xfrout/tests/xfrout_test.py Fri Nov  5 10:24:07 2010
@@ -58,7 +58,7 @@
         del self.sendqueue[:]
 
 # We subclass the Session class we're testing here, only
-# to override the __init__() method, which wants a socket,
+# to override the handle() and _send_data() method
 class MyXfroutSession(XfroutSession):
     def handle(self):
         pass

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 Fri Nov  5 10:24:07 2010
@@ -80,14 +80,20 @@
         BaseRequestHandler.__init__(self, request, client_address, server)
 
     def handle(self):
-        # Handle a request until shutdown or xfrout client is closed.
+        '''Handle a request until shutdown or xfrout client is closed.'''
+        # check self.server._shutdown_event to ensure the real shutdown comes
         while not self.server._shutdown_event.is_set(): # Check if xfrout is shutdown
             try:
-                rlist, wlist, xlist = select.select([self._shutdown_sock, self.request], [], [])
+                (rlist, wlist, xlist) = select.select([self._shutdown_sock, self.request], [], [])
             except select.error as e:
-                if not e.args[0] == errno.EINTR:
+                if e.args[0] == errno.EINTR:
+                    (rlist, wlist, xlist) = ([], [], [])
+                    continue
+                else:
                     self._log.log_message("error", "Error with select(): %s" %e)
-                break
+                    break
+            # self.server._shutdown_evnet will be set by now, if it is not a false
+            # alarm
             if self._shutdown_sock in rlist:
                 continue
 

Modified: branches/trac299/src/lib/xfr/fd_share.h
==============================================================================
--- branches/trac299/src/lib/xfr/fd_share.h (original)
+++ branches/trac299/src/lib/xfr/fd_share.h Fri Nov  5 10:24:07 2010
@@ -29,7 +29,7 @@
 // Errors are indicated by a return value of -1.
 int recv_fd(const int sock);
 
-// Send socket descriptor "fd" to server over unix domain socket 'sock', 
+// Send socket descriptor "fd" to server over unix domain socket 'sock',
 // the connection from socket 'sock' to unix domain server should be established first.
 // Errors are indicated by a return value of -1.
 int send_fd(const int sock, const int fd);

Modified: branches/trac299/src/lib/xfr/fdshare_python.cc
==============================================================================
--- branches/trac299/src/lib/xfr/fdshare_python.cc (original)
+++ branches/trac299/src/lib/xfr/fdshare_python.cc Fri Nov  5 10:24:07 2010
@@ -71,7 +71,7 @@
 
     PyObject *XFR_FD_RECEIVE_FAIL = Py_BuildValue("i", isc::xfr::XFR_FD_RECEIVE_FAIL);
     if (XFR_FD_RECEIVE_FAIL == NULL) {
-        Py_XDECREF(mod); 
+        Py_XDECREF(mod);
         return (NULL);
     }
     int ret = PyModule_AddObject(mod, "XFR_FD_RECEIVE_FAIL", XFR_FD_RECEIVE_FAIL);




More information about the bind10-changes mailing list