diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-03-10 10:51:38 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-03-10 11:04:53 +0000 |
commit | 61962b27a51031965cef70451d369b115868fb11 (patch) | |
tree | 6f65d228cf5a80ad31430bf03951f5ed198bdf10 /lib/raindrops/middleware/proxy.rb | |
parent | 8392f8186cd21f9190474bd6b5ac6ec58c7af96a (diff) | |
download | raindrops-61962b27a51031965cef70451d369b115868fb11.tar.gz |
Of course, RDoc doesn't know quantity vs quality :)
Diffstat (limited to 'lib/raindrops/middleware/proxy.rb')
-rw-r--r-- | lib/raindrops/middleware/proxy.rb | 8 |
1 files changed, 8 insertions, 0 deletions
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) |