parameters: (self)
return_statement: return True
docstring: Decode the 'chunked' transfer coding.
docstring_summary: Decode the 'chunked' transfer coding.
docstring_tokens: Decode the chunked transfer coding .
function: def decode_chunked(self):
          """Decode the 'chunked' transfer coding."""
          cl = 0
          data = StringIO.StringIO()
          while True:
              line = self.rfile.readline().strip().split(";", 1)
              chunk_size = int(line.pop(0), 16)
              if chunk_size <= 0:
                  break
  ##            if line: chunk_extension = line[0]
              cl += chunk_size
              data.write(self.rfile.read(chunk_size))
              crlf = self.rfile.read(2)
              if crlf != "\r\n":
                  self.simple_response("400 Bad Request",
                                       "Bad chunked transfer coding "
                                       "(expected '\\r\\n', got %r)" % crlf)
                  return
          
          # Grab any trailer headers
          self.read_headers()
          
          data.seek(0)
          self.environ["wsgi.input"] = data
          self.environ["CONTENT_LENGTH"] = str(cl) or ""
          return True
function_tokens: def decode_chunked ( self ) : cl = 0 data = StringIO . StringIO ( ) while True : line = self . rfile . readline ( ) . strip ( ) . split ( ";" , 1 ) chunk_size = int ( line . pop ( 0 ) , 16 ) if chunk_size <= 0 : break ##            if line: chunk_extension = line[0] cl += chunk_size data . write ( self . rfile . read ( chunk_size ) ) crlf = self . rfile . read ( 2 ) if crlf != "\r\n" : self . simple_response ( "400 Bad Request" , "Bad chunked transfer coding " "(expected '\\r\\n', got %r)" % crlf ) return # Grab any trailer headers self . read_headers ( ) data . seek ( 0 ) self . environ [ "wsgi.input" ] = data self . environ [ "CONTENT_LENGTH" ] = str ( cl ) or "" return True