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_body(self, code, headers, delegate):
      if "Content-Length" in headers:
          if "Transfer-Encoding" in headers:
              # Response cannot contain both Content-Length and
              # Transfer-Encoding headers.
              # http://tools.ietf.org/html/rfc7230#section-3.3.3
              raise httputil.HTTPInputError(
                  "Response with both Transfer-Encoding and Content-Length"
              )
          if "," in headers["Content-Length"]:
              # Proxies sometimes cause Content-Length headers to get
              # duplicated.  If all the values are identical then we can
              # use them but if they differ it's an error.
              pieces = re.split(r",\s*", headers["Content-Length"])
              if any(i != pieces[0] for i in pieces):
                  raise httputil.HTTPInputError(
                      "Multiple unequal Content-Lengths: %r"
                      % headers["Content-Length"]
                  )
              headers["Content-Length"] = pieces[0]
  
          try:
              content_length = int(headers["Content-Length"])
          except ValueError:
              # Handles non-integer Content-Length value.
              raise httputil.HTTPInputError(
                  "Only integer Content-Length is allowed: %s"
                  % headers["Content-Length"]
              )
  
          if content_length > self._max_body_size:
              raise httputil.HTTPInputError("Content-Length too long")
      else:
          content_length = None
  
      if code == 204:
          # This response code is not allowed to have a non-empty body,
          # and has an implicit length of zero instead of read-until-close.
          # http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3
          if "Transfer-Encoding" in headers or content_length not in (
              None,
              0,
          ):
              raise httputil.HTTPInputError(
                  "Response with code %d should not have body" % code
              )
          content_length = 0
  
      if content_length is not None:
          return self._read_fixed_body(content_length, delegate)
      if headers.get("Transfer-Encoding", "").lower() == "chunked":
          return self._read_chunked_body(delegate)
      if self.is_client:
          return self._read_body_until_close(delegate)
      return None
  
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 19 for calling the HTTP1Connection obj's underlying member method code with example usage: obj._read_body(code, headers, delegate) and returns: None, self, self, self