From 416d3a0f868571319a2b29b0034d2dba68e4d5b3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 22 Jul 2010 05:42:16 +0000 Subject: enable Range: responses for static files for most models The FileStreamer class of EventMachine (and by extension NeverBlock) unfortunately doesn't handle this. It's possible to do with Revactor (since it uses Rev under the covers), but we'll support what we can easily for now. --- lib/rainbows/writer_thread_pool.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/rainbows/writer_thread_pool.rb') diff --git a/lib/rainbows/writer_thread_pool.rb b/lib/rainbows/writer_thread_pool.rb index 4050af9..dd3dd7c 100644 --- a/lib/rainbows/writer_thread_pool.rb +++ b/lib/rainbows/writer_thread_pool.rb @@ -47,8 +47,8 @@ module Rainbows end module Response # :nodoc: - def write_body(qclient, body) - qclient.q << [ qclient.to_io, :body, body ] + def write_body(qclient, body, range) + qclient.q << [ qclient.to_io, :body, body, range ] end end @@ -70,9 +70,9 @@ module Rainbows qp = (1..worker_connections).map do |n| QueuePool.new(1) do |response| begin - io, arg1, arg2 = response + io, arg1, arg2, arg3 = response case arg1 - when :body then sync_write_body(io, arg2) + when :body then sync_write_body(io, arg2, arg3) when :close then io.close unless io.closed? else io.write(arg1) -- cgit v1.2.3-24-ge0c7