class_docstr: Implements the HTTP/1.x protocol.
  
  This class can be on its own for clients, or via `HTTP1ServerConnection`
  for servers.
class_docstr_tok: ["Implements","the","HTTP\/1.x","protocol",".","This","class","can","be","on","its","own","for","clients",",","or","via","`","HTTP1ServerConnection","`","for","servers","."]
code: def _read_chunked_body(self, delegate):
      # TODO: "chunk extensions" http://tools.ietf.org/html/rfc2616#section-3.6.1
      total_size = 0
      while True:
          chunk_len = yield self.stream.read_until(
              b"\r\n", max_bytes=64
          )
          chunk_len = int(chunk_len.strip(), 16)
          if chunk_len == 0:
              crlf = yield self.stream.read_bytes(2)
              if crlf != b"\r\n":
                  raise httputil.HTTPInputError(
                      "improperly terminated chunked request"
                  )
              return
          total_size += chunk_len
          if total_size > self._max_body_size:
              raise httputil.HTTPInputError("chunked body too large")
          bytes_to_read = chunk_len
          while bytes_to_read:
              chunk = yield self.stream.read_bytes(
                  min(bytes_to_read, self.params.chunk_size),
                  partial=True,
              )
              bytes_to_read -= len(chunk)
              if not self._write_finished or self.is_client:
                  with _ExceptionLoggingContext(app_log):
                      ret = delegate.data_received(chunk)
                      if ret is not None:
                          yield ret
          # chunk ends with \r\n
          crlf = yield self.stream.read_bytes(2)
          assert crlf == b"\r\n"
  
imports: from __future__ import absolute_import, division, print_function
  import re
  from tornado.concurrent import Future
  from tornado.escape import native_str, utf8
  from tornado import gen
  from tornado import httputil
  from tornado import iostream
  from tornado.log import gen_log, app_log
  from tornado import stack_context
  from tornado.util import GzipDecompressor, PY3
label_desc: Use image node_id 21 for calling the HTTP1Connection obj's underlying member method code with example usage: obj._read_chunked_body(delegate) without return types