From 61962b27a51031965cef70451d369b115868fb11 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 10 Mar 2011 10:51:38 +0000 Subject: rdoc: 100% documentation coverage! Of course, RDoc doesn't know quantity vs quality :) --- lib/raindrops/middleware/proxy.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/raindrops/middleware/proxy.rb') diff --git a/lib/raindrops/middleware/proxy.rb b/lib/raindrops/middleware/proxy.rb index 8b2c0c8..53e14b5 100644 --- a/lib/raindrops/middleware/proxy.rb +++ b/lib/raindrops/middleware/proxy.rb @@ -1,4 +1,7 @@ # -*- encoding: binary -*- +# :stopdoc: +# This class is by Raindrops::Middleware to proxy application response +# bodies. There should be no need to use it directly. class Raindrops::Middleware::Proxy def initialize(body, stats) @body, @stats = body, stats @@ -15,10 +18,15 @@ class Raindrops::Middleware::Proxy @body.close if @body.respond_to?(:close) end + # Some Rack servers can optimize response processing if it responds + # to +to_path+ via the sendfile(2) system call, we proxy +to_path+ + # to the underlying body if possible. def to_path @body.to_path end + # Rack servers use +respond_to?+ to check for the presence of +close+ + # and +to_path+ methods. def respond_to?(m) m = m.to_sym :close == m || @body.respond_to?(m) -- cgit v1.2.3-24-ge0c7