class TP2::HTTP1Connection

def send_chunk(request, chunk, done: false)

Returns:
  • (void) -

Parameters:
  • done (boolean) -- whether the response is completed
  • chunk (String) -- response body chunk
  • request (Qeweney::Request) -- HTTP request
def send_chunk(request, chunk, done: false)
  data = +''
  data << "#{chunk.bytesize.to_s(16)}\r\n#{chunk}\r\n" if chunk
  data << EMPTY_CHUNK if done
  return if data.empty?
  request.tx_incr(data.bytesize)
  @machine.send(@fd, data, data.bytesize, SEND_FLAGS)
  return if @done || !done
  @logger&.call(request, @response_headers)
  @done = true
end