[Zope-Checkins] CVS: Zope/lib/python/ZServer - datatypes.py:1.2.18.2

Chris McDonough chrism at zope.com
Wed Oct 1 01:12:11 EDT 2003


Update of /cvs-repository/Zope/lib/python/ZServer
In directory cvs.zope.org:/tmp/cvs-serv28434

Modified Files:
      Tag: chrism-zserver-connection-policies-branch
	datatypes.py 
Log Message:
Enable FCGI/PCGI servers to specify pool-name and connection-policy.


=== Zope/lib/python/ZServer/datatypes.py 1.2.18.1 => 1.2.18.2 ===
--- Zope/lib/python/ZServer/datatypes.py:1.2.18.1	Wed Oct  1 00:33:35 2003
+++ Zope/lib/python/ZServer/datatypes.py	Wed Oct  1 01:12:10 2003
@@ -79,6 +79,7 @@
         return HTTPServer.zhttp_handler(self.module, '', self.cgienv)
 
 
+
 class WebDAVSourceServerFactory(HTTPServerFactory):
     def createHandler(self):
         from ZServer.WebDAVSrcHandler import WebDAVSrcHandler
@@ -88,19 +89,25 @@
 class FTPServerFactory(ServerFactory):
     def __init__(self, section):
         ServerFactory.__init__(self, section.address)
+        self.thread_pool = getattr(section, 'thread_pool', 'default')
+        self.policy = getattr(section, 'zodb_connection_policy', 'default')
 
     def create(self):
         from ZServer.AccessLogger import access_logger
         from ZServer.FTPServer import FTPServer
         return FTPServer(ip=self.host, port=self.port,
                          module=self.module, resolver=self.dnsresolver,
-                         logger_object=access_logger)
+                         logger_object=access_logger,
+                         pool_name=self.thread_pool,
+                         connection_policy=self.policy)
 
 
 class PCGIServerFactory(ServerFactory):
     def __init__(self, section):
         ServerFactory.__init__(self)
         self.path = section.path
+        self.thread_pool = getattr(section, 'thread_pool', 'default')
+        self.policy = getattr(section, 'zodb_connection_policy', 'default')
 
     def create(self):
         from ZServer.AccessLogger import access_logger
@@ -108,7 +115,9 @@
         return PCGIServer(ip=self.host, port=self.port,
                           module=self.module, resolver=self.dnsresolver,
                           pcgi_file=self.path,
-                          logger_object=access_logger)
+                          logger_object=access_logger,
+                          pool_name=self.thread_pool,
+                          connection_policy=self.policy)
 
 
 class FCGIServerFactory(ServerFactory):
@@ -122,6 +131,8 @@
             path = section.address.address
         ServerFactory.__init__(self, address)
         self.path = path
+        self.thread_pool = getattr(section, 'thread_pool', 'default')
+        self.policy = getattr(section, 'zodb_connection_policy', 'default')
 
     def _set_default_host(self, host):
         if self.path is None:
@@ -133,7 +144,9 @@
         return FCGIServer(ip=self.host, port=self.port,
                           socket_file=self.path,
                           module=self.module, resolver=self.dnsresolver,
-                          logger_object=access_logger)
+                          logger_object=access_logger,
+                          pool_name=self.thread_pool,
+                          connection_policy=self.policy)
 
 
 class MonitorServerFactory(ServerFactory):




More information about the Zope-Checkins mailing list