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/stream_file.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/rainbows/stream_file.rb') diff --git a/lib/rainbows/stream_file.rb b/lib/rainbows/stream_file.rb index dec58b0..11c84d4 100644 --- a/lib/rainbows/stream_file.rb +++ b/lib/rainbows/stream_file.rb @@ -5,8 +5,7 @@ # models. We always maintain our own file offsets in userspace because # because sendfile() implementations offer pread()-like idempotency for # concurrency (multiple clients can read the same underlying file handle). -class Rainbows::StreamFile < Struct.new(:offset, :to_io, :body) - +class Rainbows::StreamFile < Struct.new(:offset, :count, :to_io, :body) def close body.close if body.respond_to?(:close) to_io.close unless to_io.closed? -- cgit v1.2.3-24-ge0c7