diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-11-11 02:16:50 +0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-11-11 07:18:20 +0800 |
commit | a89ccf321224f3248ddd00bb0edb320311604e4e (patch) | |
tree | 669d6af1eee6c70d72bdeba6f77d9a7114cf54ed /lib/unicorn/http_server.rb | |
parent | 7d44b5384758aeddcb49d7606a9908308df7c698 (diff) | |
download | unicorn-a89ccf321224f3248ddd00bb0edb320311604e4e.tar.gz |
This allows users to override the current Rack spec and disable the rewindable input requirement. This can allow applications to use less I/O to minimize the performance impact when processing uploads.
Diffstat (limited to 'lib/unicorn/http_server.rb')
-rw-r--r-- | lib/unicorn/http_server.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb index 69b7cc8..f0dca7c 100644 --- a/lib/unicorn/http_server.rb +++ b/lib/unicorn/http_server.rb @@ -355,6 +355,15 @@ class Unicorn::HttpServer kill_each_worker(:KILL) end + def rewindable_input + Unicorn::HttpRequest.input_class.method_defined?(:rewind) + end + + def rewindable_input=(bool) + Unicorn::HttpRequest.input_class = bool ? + Unicorn::TeeInput : Unicorn::StreamInput + end + private # wait for a signal hander to wake us up and then consume the pipe |