private Method

HTTPResponse.send_body_io(socket)

There's no documentation for this item.

Source Code

# File webrick/httpresponse.rb, line 258
def send_body_io(socket)
  begin
    if @request_method == "HEAD"
      # do nothing
    elsif chunked?
      while buf = @body.read(BUFSIZE)
        next if buf.empty?
        data = ""
        data << format("%x", buf.size) << CRLF
        data << buf << CRLF
        _write_data(socket, data)
        @sent_size += buf.size
      end
      _write_data(socket, "0#{CRLF}#{CRLF}")
    else
      size = @header['content-length'].to_i
      _send_file(socket, @body, 0, size)
      @sent_size = size
    end
  ensure
    @body.close
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.