Changeset 585
- Timestamp:
- 09/01/05 19:06:36
- Files:
-
- trunk/cherrypy/_cpcgifs.py (modified) (1 diff)
- trunk/cherrypy/config.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cpcgifs.py
r321 r585 1 1 import cgi 2 import cherrypy 2 3 4 try: 5 from threading import local 6 except ImportError: 7 from cherrypy._cpthreadinglocal import local 3 8 9 class LocalInt: 10 def __init__(self, value): 11 self.__local = local() 12 self.__local.value = value 13 14 def __int__(self): 15 return self.__local.value 16 17 def __nonzero__(self): 18 return bool(self.__local.value) 19 20 def __str__(self): 21 return str(self.__local.value) 22 4 23 class FieldStorage(cgi.FieldStorage): 5 24 def __init__(self, *args, **kwds): 25 maxlen = cherrypy.config.get('server.maxRequestSize') 26 cgi.maxlen = LocalInt(maxlen) 27 28 try: 29 cgi.FieldStorage.__init__(self, *args, **kwds) 30 except ValueError: 31 ec = cherrypy._cperror.HTTPClientError 32 raise ec(status=413) 33 6 34 def read_lines_to_eof(self): 7 35 """Internal: read lines until EOF.""" trunk/cherrypy/config.py
r565 r585 54 54 'server.reverseDNS': False, 55 55 'server.threadPool': 0, 56 57 'server.maxRequestSize' : 0, # 0 == unlimited 56 58 } 57 59

