[Zope-Checkins] CVS: Zope/lib/python/ZServer - FCGIServer.py:1.22.8.3 FTPServer.py:1.26.8.5 HTTPServer.py:1.46.2.4 PCGIServer.py:1.26.8.4 __init__.py:1.29.8.2

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


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

Modified Files:
      Tag: Zope-2_7-branch
	FCGIServer.py FTPServer.py HTTPServer.py PCGIServer.py 
	__init__.py 
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
        module.


=== Zope/lib/python/ZServer/FCGIServer.py 1.22.8.2 => 1.22.8.3 ===
--- Zope/lib/python/ZServer/FCGIServer.py:1.22.8.2	Thu Jan  8 18:34:02 2004
+++ Zope/lib/python/ZServer/FCGIServer.py	Wed Dec  1 18:01:48 2004
@@ -32,7 +32,7 @@
 from medusa.counter import counter
 from medusa.http_server import compute_timezone_for_log
 
-from ZServer import CONNECTION_LIMIT, requestCloseOnExec
+from ZServer import requestCloseOnExec
 
 from PubCore import handle
 from PubCore.ZEvent import Wakeup
@@ -642,6 +642,7 @@
 
 
     def readable(self):
+        from ZServer import CONNECTION_LIMIT
         return len(asyncore.socket_map) < CONNECTION_LIMIT
 
 


=== Zope/lib/python/ZServer/FTPServer.py 1.26.8.4 => 1.26.8.5 ===
--- Zope/lib/python/ZServer/FTPServer.py:1.26.8.4	Sun Mar 28 06:11:48 2004
+++ Zope/lib/python/ZServer/FTPServer.py	Wed Dec  1 18:01:48 2004
@@ -72,7 +72,7 @@
 from FTPResponse import make_response
 from FTPRequest import FTPRequest
 
-from ZServer import CONNECTION_LIMIT, requestCloseOnExec
+from ZServer import requestCloseOnExec
 
 from cStringIO import StringIO
 import os
@@ -653,6 +653,7 @@
         self.ftp_channel_class (self, conn, addr, self.module)
 
     def readable(self):
+        from ZServer import CONNECTION_LIMIT
         return len(asyncore.socket_map) < CONNECTION_LIMIT
 
     def listen(self, num):


=== Zope/lib/python/ZServer/HTTPServer.py 1.46.2.3 => 1.46.2.4 ===
--- Zope/lib/python/ZServer/HTTPServer.py:1.46.2.3	Sat Nov 27 03:24:29 2004
+++ Zope/lib/python/ZServer/HTTPServer.py	Wed Dec  1 18:01:48 2004
@@ -53,7 +53,7 @@
 from medusa.default_handler import unquote
 from asyncore import compact_traceback, dispatcher
 
-from ZServer import CONNECTION_LIMIT, ZOPE_VERSION, ZSERVER_VERSION
+from ZServer import ZOPE_VERSION, ZSERVER_VERSION
 from ZServer import requestCloseOnExec
 from zLOG import LOG, register_subsystem, BLATHER, INFO, WARNING, ERROR
 import DebugLogger
@@ -75,9 +75,10 @@
 
 class zhttp_collector:
     def __init__(self, handler, request, size):
+        from ZServer import LARGE_FILE_THRESHOLD
         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')
@@ -409,8 +410,9 @@
         requestCloseOnExec(self.socket)
 
     def readable(self):
+        from ZServer import CONNECTION_LIMIT
         return self.accepting and \
-                len(asyncore.socket_map) < CONNECTION_LIMIT
+               len(asyncore.socket_map) < CONNECTION_LIMIT
 
     def listen(self, num):
         # override asyncore limits for nt's listen queue size


=== Zope/lib/python/ZServer/PCGIServer.py 1.26.8.3 => 1.26.8.4 ===
--- Zope/lib/python/ZServer/PCGIServer.py:1.26.8.3	Thu Jan  8 18:34:02 2004
+++ Zope/lib/python/ZServer/PCGIServer.py	Wed Dec  1 18:01:48 2004
@@ -35,7 +35,7 @@
 from asyncore import compact_traceback
 
 import ZServer
-from ZServer import CONNECTION_LIMIT, requestCloseOnExec
+from ZServer import requestCloseOnExec
 
 from PubCore import handle
 from PubCore.ZEvent import Wakeup
@@ -327,6 +327,7 @@
         self.channel_class(self, conn, addr)
 
     def readable(self):
+        from ZServer import CONNECTION_LIMIT
         return len(asyncore.socket_map) < CONNECTION_LIMIT
 
     def writable (self):


=== Zope/lib/python/ZServer/__init__.py 1.29.8.1 => 1.29.8.2 ===
--- Zope/lib/python/ZServer/__init__.py:1.29.8.1	Mon Jul 21 12:37:27 2003
+++ Zope/lib/python/ZServer/__init__.py	Wed Dec  1 18:01:48 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