1 # -*- encoding: binary -*-
3 module Rainbows::Rev::Sendfile
4 if IO.method_defined?(:sendfile_nonblock)
5 def rev_sendfile(sf) # +sf+ is a Rainbows::StreamFile object
6 sf.offset += (n = @_io.sendfile_nonblock(sf, sf.offset, sf.count))
7 0 == (sf.count -= n) and raise EOFError
13 def rev_sendfile(body)
14 write(body.to_io.sysread(0x4000))