[Zope-Checkins] CVS: Zope/lib/python/ZServer - HTTPServer.py:1.46.2.2.16.1 __init__.py:1.29.8.1.20.1

Sidnei da Silva sidnei at awkly.org
Wed Nov 3 15:15:08 EST 2004


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

Modified Files:
      Tag: dc-large_file-branch
	HTTPServer.py __init__.py 
Log Message:
Create a directive for configuring the large file threshold where temp files are created and use it for NullResource.PUT.


=== Zope/lib/python/ZServer/HTTPServer.py 1.46.2.2 => 1.46.2.2.16.1 ===
--- Zope/lib/python/ZServer/HTTPServer.py:1.46.2.2	Sun Dec 14 22:11:43 2003
+++ Zope/lib/python/ZServer/HTTPServer.py	Wed Nov  3 15:14:32 2004
@@ -53,7 +53,7 @@
 from asyncore import compact_traceback, dispatcher
 
 from ZServer import CONNECTION_LIMIT, ZOPE_VERSION, ZSERVER_VERSION
-from ZServer import requestCloseOnExec
+from ZServer import requestCloseOnExec, LARGE_FILE_THRESHOLD
 from zLOG import LOG, register_subsystem, BLATHER, INFO, WARNING, ERROR
 import DebugLogger
 from medusa import logger
@@ -76,7 +76,7 @@
     def __init__(self, handler, request, size):
         self.handler = handler
         self.request = request
-        if size > 524288:
+        if size > LARGE_FILE_THRESHOLD:
             # write large upload data to a file
             from tempfile import TemporaryFile
             self.data = TemporaryFile('w+b')


=== Zope/lib/python/ZServer/__init__.py 1.29.8.1 => 1.29.8.1.20.1 ===
--- Zope/lib/python/ZServer/__init__.py:1.29.8.1	Mon Jul 21 12:37:27 2003
+++ Zope/lib/python/ZServer/__init__.py	Wed Nov  3 15:14:32 2004
@@ -21,13 +21,18 @@
 exit_code = 0
 
 # the ZServer version number
-ZSERVER_VERSION='1.1'
+ZSERVER_VERSION = '1.1'
 
 # the maximum number of incoming connections to ZServer
-CONNECTION_LIMIT=1000 # may be reset by max_listen_sockets handler in Zope
+CONNECTION_LIMIT = 1000 # may be reset by max_listen_sockets handler in Zope
+
+# request bigger than this size get saved into a
+# temporary file instead of being read completely into memory
+LARGE_FILE_THRESHOLD = 1 << 19 # may be reset by large_file_threshold
+                               # handler in Zope
 
 # the Zope version string
-ZOPE_VERSION=utils.getZopeVersion()
+ZOPE_VERSION = utils.getZopeVersion()
 
 # backwards compatibility aliases
 from utils import requestCloseOnExec



More information about the Zope-Checkins mailing list