class Puma::Client

def reset(fast_check=true)

def reset(fast_check=true)
  @parser.reset
  @io_buffer.reset
  @read_header = true
  @read_proxy = !!@expect_proxy_proto
  @env = @proto_env.dup
  @body = nil
  @tempfile = nil
  @parsed_bytes = 0
  @ready = false
  @body_remain = 0
  @peerip = nil if @remote_addr_header
  @in_last_chunk = false
  @http_content_length_limit_exceeded = false
  if @buffer
    return false unless try_to_parse_proxy_protocol
    @parsed_bytes = @parser.execute(@env, @buffer, @parsed_bytes)
    if @parser.finished?
      return setup_body
    elsif @parsed_bytes >= MAX_HEADER
      raise HttpParserError,
        "HEADER is longer than allowed, aborting client early."
    end
    return false
  else
    begin
      if fast_check && @to_io.wait_readable(FAST_TRACK_KA_TIMEOUT)
        return try_to_finish
      end
    rescue IOError
      # swallow it
    end
  end
end