private Method

HTTPResponse.send_body_string(socket)

There's no documentation for this item.

Source Code

# File webrick/httpresponse.rb, line 282
def send_body_string(socket)
  if @request_method == "HEAD"
    # do nothing
  elsif chunked?
    remain = body ? @body.size : 0
    while buf = @body[@sent_size, BUFSIZE]
      break 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
    if @body && @body.size > 0
      _write_data(socket, @body)
      @sent_size = @body.size
    end
  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.