Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1486

Show
Ignore:
Timestamp:
12/09/06 13:21:38
Author:
fumanchu
Message:

2.x backport of [1096] (moved request body size check into _cprequest from _cpwsgi).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/cherrypy-2.x/cherrypy/_cpengine.py

    r989 r1486  
    6262            and conf('session.storage_type') == 'file'): 
    6363            cherrypy._sessionFileLock = threading.RLock() 
    64          
    65         # set cgi.maxlen which will limit the size of POST request bodies 
    66         cgi.maxlen = conf('server.max_request_size') 
    6764         
    6865        # Set up the profiler if requested. 
  • branches/cherrypy-2.x/cherrypy/_cphttptools.py

    r1210 r1486  
    9696                    applyFilters('before_request_body') 
    9797                    if self.processRequestBody: 
     98                        # Prepare the SizeCheckWrapper for the request body 
     99                        mbs = int(cherrypy.config.get('server.max_request_body_size', 
     100                                                      100 * 1024 * 1024)) 
     101                        if mbs > 0: 
     102                            self.rfile = httptools.SizeCheckWrapper(self.rfile, mbs) 
     103                         
    98104                        self.processBody() 
    99105                     
  • branches/cherrypy-2.x/cherrypy/_cpwsgi.py

    r1483 r1486  
    159159                    path = "global" 
    160160                 
    161                 # Prepare the SizeCheckWrapper for the request body 
    162                 mbs = int(cherrypy.config.get('server.max_request_body_size', 
    163                                               100 * 1024 * 1024, path=path)) 
    164161                if isinstance(self.rfile, httptools.SizeCheckWrapper): 
    165                     if mbs > 0: 
    166                         self.rfile.bytes_read = 0 
    167                         self.rfile.maxlen = mbs 
    168                     else: 
    169                         # Unwrap the rfile 
    170                         self.rfile = self.rfile.rfile 
    171                 else: 
    172                     if mbs > 0: 
    173                         self.rfile = httptools.SizeCheckWrapper(self.rfile, mbs) 
     162                    # Unwrap the rfile 
     163                    self.rfile = self.rfile.rfile 
    174164                self.environ["wsgi.input"] = self.rfile 
    175165 

Hosted by WebFaction

Log in as guest/cpguest to create tickets