def GetRequestSize(request, env_dict, outfile):
 if ('content-length' in request.headers):
  request_size = int(request.headers['content-length'])
 elif (env_dict and (env_dict.get('REQUEST_METHOD', '') == 'POST')):
  _WriteErrorToOutput(('%d Length required' % httplib.LENGTH_REQUIRED), 'POST requests require a Content-length header.', outfile)
  return None
 else:
  request_size = 0
 if (request_size <= MAX_REQUEST_SIZE):
  return request_size
 else:
  msg = ('HTTP request was too large: %d.  The limit is: %d.' % (request_size, MAX_REQUEST_SIZE))
  _WriteErrorToOutput(('%d Request entity too large' % httplib.REQUEST_ENTITY_TOO_LARGE), msg, outfile)
  return None

def GetRequestSize ( request , env_dict , outfile ) : if ( 'content-length' in request . headers ) : request_size = int ( request . headers [ 'content-length' ] ) elif ( env_dict and ( env_dict . get ( 'REQUEST_METHOD' , '' ) == 'POST' ) ) : _WriteErrorToOutput ( ( '%d Length required' % httplib . LENGTH_REQUIRED ) , 'POST requests require a Content-length header.' , outfile ) return None else : request_size = 0 if ( request_size <= MAX_REQUEST_SIZE ) : return request_size else : msg = ( 'HTTP request was too large: %d.  The limit is: %d.' % ( request_size , MAX_REQUEST_SIZE ) ) _WriteErrorToOutput ( ( '%d Request entity too large' % httplib . REQUEST_ENTITY_TOO_LARGE ) , msg , outfile ) return None
gets the size of the given request .