diff options
author | Eric Wong <e@80x24.org> | 2016-02-12 00:55:46 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-02-12 00:55:46 +0000 |
commit | f6dd9694b43c2625f514e89856834a633b70f91b (patch) | |
tree | 4892bb6ef45fc730adc7a78b0da551d14444e17b /lib | |
parent | 2f820a252252152118ac126546759494d8e6eecc (diff) | |
download | yahns-f6dd9694b43c2625f514e89856834a633b70f91b.tar.gz |
We cannot use the sendfile(2) syscall when serving static files to TLS clients without breaking them. We currently rely on OpenSSL to encrypt the data before it hits the socket, so it must be read into userspace buffers before being written to the socket.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/yahns/sendfile_compat.rb | 4 | ||||
-rw-r--r-- | lib/yahns/wbuf_common.rb | 1 |
2 files changed, 1 insertions, 4 deletions
diff --git a/lib/yahns/sendfile_compat.rb b/lib/yahns/sendfile_compat.rb index cdd2d7b..8bd4622 100644 --- a/lib/yahns/sendfile_compat.rb +++ b/lib/yahns/sendfile_compat.rb @@ -22,7 +22,3 @@ module Yahns::SendfileCompat # :nodoc: end while true end end - -class IO # :nodoc: - include Yahns::SendfileCompat -end diff --git a/lib/yahns/wbuf_common.rb b/lib/yahns/wbuf_common.rb index 21e9b3a..c51050b 100644 --- a/lib/yahns/wbuf_common.rb +++ b/lib/yahns/wbuf_common.rb @@ -7,6 +7,7 @@ begin require 'sendfile' rescue LoadError require_relative 'sendfile_compat' + IO.__send__ :include, Yahns::SendfileCompat end module Yahns::WbufCommon # :nodoc: |