Packaging cleanups, reinstate generated files for the tarball
[rainbows.git] / lib / rainbows / rack_input.rb
blobdf51ac161e0e1c0e2d30ba7463a714e4d214a8e0
1 # -*- encoding: binary -*-
2 # :enddoc:
3 # only used by synchronous interfaces
4 module Rainbows::RackInput
5   NULL_IO = Unicorn::HttpRequest::NULL_IO
6   RACK_INPUT = Unicorn::HttpRequest::RACK_INPUT
7   CLIENT_IO = Rainbows::Const::CLIENT_IO
9   def self.setup
10     const_set(:IC, Unicorn::HttpRequest.input_class)
11   end
13   def set_input(env, hp, client)
14     env[RACK_INPUT] = 0 == hp.content_length ? NULL_IO : IC.new(client, hp)
15     env[CLIENT_IO] = client
16   end
17 end