read_chunked(socket, block) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/webrick/httprequest.rb, line 307
    def read_chunked(socket, block)
      chunk_size, = read_chunk_size(socket)
      while chunk_size > 0
        data = ""
        while data.size < chunk_size
          tmp = read_data(socket, chunk_size-data.size) # read chunk-data
          break unless tmp
          data << tmp
        end
        if data.nil? || data.size != chunk_size
          raise BadRequest, "bad chunk data size."
        end
        read_line(socket)                    # skip CRLF
        block.call(data)
        chunk_size, = read_chunk_size(socket)
      end
      read_header(socket)                    # trailer + CRLF
      @header.delete("transfer-encoding")
      @remaining_size = 0
    end
Register or log in to add new notes.