[svn] commit: r2626 - in /branches/trac216: ChangeLog src/bin/auth/Makefile.am src/bin/xfrin/xfrin.py.in

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Aug 4 09:42:42 UTC 2010


Author: shentingting
Date: Wed Aug  4 09:42:42 2010
New Revision: 2626

Log:
add proposed changelog entry, change a variable name and a initation statement

Modified:
    branches/trac216/ChangeLog
    branches/trac216/src/bin/auth/Makefile.am
    branches/trac216/src/bin/xfrin/xfrin.py.in

Modified: branches/trac216/ChangeLog
==============================================================================
--- branches/trac216/ChangeLog (original)
+++ branches/trac216/ChangeLog Wed Aug  4 09:42:42 2010
@@ -1,3 +1,12 @@
+  77.   [func]      shentingting
+    Add config_handler function to make new config data to be applied.
+    Using socket pair communication mechanism to achieve quickly terminate
+	on shutdown command, and still using a global flag. Deal with
+	connection exception(the master closes connection etc.) during
+	transmission.
+	(Trac #216, rTDB)
+
+
   76.	[bug]		jelte
 	Fixed a bug in the handling of 'remote' config modules (i.e.
 	modules that peek at the configuration of other modules), where

Modified: branches/trac216/src/bin/auth/Makefile.am
==============================================================================
--- branches/trac216/src/bin/auth/Makefile.am (original)
+++ branches/trac216/src/bin/auth/Makefile.am Wed Aug  4 09:42:42 2010
@@ -6,7 +6,7 @@
 AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
 
 AM_CXXFLAGS = $(B10_CXXFLAGS)
-
+AM_CXXFLAGS += -lpthread
 pkglibexecdir = $(libexecdir)/@PACKAGE@
 
 CLEANFILES = *.gcno *.gcda auth.spec spec_config.h
@@ -54,7 +54,7 @@
 b10_auth_LDADD += $(top_builddir)/src/lib/cc/.libs/libcc.a
 b10_auth_LDADD += $(top_builddir)/src/lib/exceptions/.libs/libexceptions.a
 b10_auth_LDADD += $(top_builddir)/src/bin/auth/libasio_link.a
-b10_auth_LDADD += $(SQLITE_LIBS)
+b10_auth_LDADD += -lsqlite3
 b10_auth_LDADD += $(top_builddir)/src/lib/xfr/.libs/libxfr.a
 
 # TODO: config.h.in is wrong because doesn't honor pkgdatadir

Modified: branches/trac216/src/bin/xfrin/xfrin.py.in
==============================================================================
--- branches/trac216/src/bin/xfrin/xfrin.py.in (original)
+++ branches/trac216/src/bin/xfrin/xfrin.py.in Wed Aug  4 09:42:42 2010
@@ -373,14 +373,15 @@
 
 class Xfrin:
     def __init__(self, verbose = False):
+        self._max_transfers_in = 10
         self._cc_setup()
         self._shutdown_flag = 0
         self._verbose = verbose
 
-        #the item in self._zones: zone name and xfr communication thread. 
+        #the item in self._threads_zones: zone name and xfr communication thread. 
         #The item in self._conn_sockets: a socket and xfr communication thread, the main thread uses 
         #the socket to communicate with this xfr communication thread.
-        self._zones = {}
+        self._threads_zones = {}
         self._conn_sockets = {}
 
     def _cc_setup(self):
@@ -392,7 +393,6 @@
         self._cc = isc.config.ModuleCCSession(SPECFILE_LOCATION,
                                               self.config_handler,
                                               self.command_handler)
-        
         self._cc.start()
         config_data = self._cc.get_full_config()
         self._max_transfers_in = config_data.get("transfers_in")
@@ -483,7 +483,7 @@
             self._cc_check_command()
 
     def _filter_hash(self, hash):
-        '''delete zone_name in self._zones or a socket in self._conn_sockets.'''
+        '''delete zone_name in self._threads_zones or a socket in self._conn_sockets.'''
         keys = []
         for key in hash.keys():
             keys.append(key)
@@ -498,16 +498,16 @@
             return (1, "xfrin failed, can't load dns message python library: 'libdns_python'")
 
         # check max_transfer_in, else return quota error
-        if len(self._zones) >= self._max_transfers_in:
-            self._filter_hash(self._zones)
+        if len(self._threads_zones) >= self._max_transfers_in:
+            self._filter_hash(self._threads_zones)
             self._filter_hash(self._conn_sockets)
-            if len(self._zones) >= self._max_transfers_in:
+            if len(self._threads_zones) >= self._max_transfers_in:
                 return (1, 'xfrin quota error')
 
         # check whether the zone xfrin is in progress.
-        if zone_name in self._zones.keys():
-            if not (self._zones[zone_name]).is_alive():
-                del self._zones[zone_name]
+        if zone_name in self._threads_zones.keys():
+            if not (self._threads_zones[zone_name]).is_alive():
+                del self._threads_zones[zone_name]
             else:
                 return (1, 'zone xfrin is in progress')
         conn_socket = socket.socketpair()
@@ -519,7 +519,7 @@
                                                 self._verbose))
 
         # recored the zone name which zone xfrin is in process
-        self._zones[zone_name] = xfrin_thread
+        self._threads_zones[zone_name] = xfrin_thread
         self._conn_sockets[conn_socket[0]] = xfrin_thread
         xfrin_thread.start()
         return (0, 'zone xfrin is started')




More information about the bind10-changes mailing list