[Zope-Checkins] CVS: Packages/Zope/Startup - handlers.py: zopeschema.xml:

Sidnei da Silva sidnei at awkly.org
Wed Dec 1 18:02:19 EST 2004

Update of /cvs-repository/Packages/Zope/Startup
In directory cvs.zope.org:/tmp/cvs-serv30901/lib/python/Zope/Startup

Modified Files:
      Tag: Zope-2_7-branch
	handlers.py zopeschema.xml 
Log Message:

      - webdav.NullResource: doing a PUT of a large file could
        potentially bring your box to a halt, because the whole file
        would be read into memory just to detect the
        content-type. Added a 'large-file-threshold' directive to
        control the boundary where a file gets read completely into
        memory. The same directive controls the creation of a tmpfile
        vs. reading the whole request into memory on ZServer as well.

      - The 'connection-limit' directive was not taking effect as it
        modified a module-level global that was already bound to the
        functions that used it by the time the directive took
        effect. Modified the functions so that they import the
        variable in the function body instead of at the top of the

=== Packages/Zope/Startup/handlers.py => ===
--- Packages/Zope/Startup/handlers.py:	Sat Nov 27 03:24:29 2004
+++ Packages/Zope/Startup/handlers.py	Wed Dec  1 18:01:48 2004
@@ -120,6 +120,10 @@
 def http_header_max_length(value):
     return value
+def large_file_threshold(value):
+    import ZServer
+    ZServer.LARGE_FILE_THRESHOLD = value
 # server handlers
 def root_handler(config):

=== Packages/Zope/Startup/zopeschema.xml => ===
--- Packages/Zope/Startup/zopeschema.xml:	Sat Nov 27 03:24:29 2004
+++ Packages/Zope/Startup/zopeschema.xml	Wed Dec  1 18:01:48 2004
@@ -731,14 +731,23 @@
-  <!-- max-listen-sockets should really go into the ZServer package, but
-       I can't quite figure out how to put it there -->
+  <!-- max-listen-sockets and large-file-threshold should really go
+       into the ZServer package, but I can't quite figure out how to
+       put it there -->
   <key name="max-listen-sockets" datatype="integer"
        handler="max_listen_sockets" default="1000">
        The maximum number of sockets that ZServer will attempt to open
        in order to service incoming connections.
+     </description>
+  </key>
+  <key name="large-file-threshold" datatype="byte-size"
+       handler="large_file_threshold" default="512KB">
+     <description>
+       Requests bigger than this size get saved into a temporary file
+       instead of being read completely into memory.

More information about the Zope-Checkins mailing list