From 39f625fff05d457b01f088017f463a86d3b6c626 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 16 May 2011 19:04:06 +0000 Subject: add "copy_stream" config directive This allows using IO::Splice.copy_stream from the "io_splice" RubyGem on recent Linux systems. This also allows users to disable copy_stream usage entirely and use traditional response_body.each calls which are compatible with all Rack servers (to workaround bugs in IO.copy_stream under 1.9.2-p180). --- lib/rainbows/writer_thread_pool/client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/rainbows/writer_thread_pool') diff --git a/lib/rainbows/writer_thread_pool/client.rb b/lib/rainbows/writer_thread_pool/client.rb index f02826e..fd537ed 100644 --- a/lib/rainbows/writer_thread_pool/client.rb +++ b/lib/rainbows/writer_thread_pool/client.rb @@ -18,7 +18,7 @@ class Rainbows::WriterThreadPool::Client < Struct.new(:to_io, :q) } end - if IO.respond_to?(:copy_stream) || IO.method_defined?(:trysendfile) + if Rainbows::Response::COPY_STREAM def write_response(status, headers, body, alive) if body.respond_to?(:close) write_response_close(status, headers, body, alive) -- cgit v1.2.3-24-ge0c7