about summary refs log tree commit homepage
path: root/lib/rainbows/rev/client.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-07-06 02:05:01 +0000
committerEric Wong <normalperson@yhbt.net>2010-07-06 02:08:11 +0000
commitd0a1fcaf25b10ff1d6894d50fa981f56169195f3 (patch)
tree30badb772d6c8b4b2087b365d0fd144bce082040 /lib/rainbows/rev/client.rb
parent70ad994ae8a854477e45c877cd0e9dda41389f86 (diff)
downloadrainbows-d0a1fcaf25b10ff1d6894d50fa981f56169195f3.tar.gz
There's no need to ever change the underlying offset of a file
descriptor when using sendfile(), so don't.  This allows us to
avoid contention in the kernel/filesystem and eventually reuse
the same filesystem file descriptor for serving multiple
requests.
Diffstat (limited to 'lib/rainbows/rev/client.rb')
-rw-r--r--lib/rainbows/rev/client.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/rainbows/rev/client.rb b/lib/rainbows/rev/client.rb
index 68b3847..e0572bb 100644
--- a/lib/rainbows/rev/client.rb
+++ b/lib/rainbows/rev/client.rb
@@ -86,6 +86,7 @@ module Rainbows
         elsif st.file?
           headers.delete('Transfer-Encoding')
           headers['Content-Length'] ||= st.size.to_s
+          io = to_sendfile(io)
         else # char/block device, directory, whatever... nobody cares
           return write_response(self, response, out)
         end