about summary refs log tree commit homepage
path: root/lib/rainbows/rev/sendfile.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rainbows/rev/sendfile.rb')
-rw-r--r--lib/rainbows/rev/sendfile.rb12
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/rainbows/rev/sendfile.rb b/lib/rainbows/rev/sendfile.rb
index 414cfa1..9f421f1 100644
--- a/lib/rainbows/rev/sendfile.rb
+++ b/lib/rainbows/rev/sendfile.rb
@@ -2,12 +2,6 @@
 # :enddoc:
 module Rainbows::Rev::Sendfile
   if IO.method_defined?(:sendfile_nonblock)
-    F = Rainbows::StreamFile
-
-    def to_sendfile(io)
-      F[0, io]
-    end
-
     def rev_sendfile(body)
       body.offset += @_io.sendfile_nonblock(body, body.offset, 0x10000)
       enable_write_watcher
@@ -15,12 +9,8 @@ module Rainbows::Rev::Sendfile
         enable_write_watcher
     end
   else
-    def to_sendfile(io)
-      io
-    end
-
     def rev_sendfile(body)
-      write(body.sysread(0x4000))
+      write(body.to_io.sysread(0x4000))
     end
   end
 end