respect client_body_buffer_size in Unicorn 3.1.0
[rainbows.git] / lib / rainbows / ev_core / cap_input.rb
blob4865da42321e3eaacc9dbb16b5f23c9c03a1cc36
1 # -*- encoding: binary -*-
2 # :enddoc:
3 class Rainbows::EvCore::CapInput
5   def initialize(io, client, max)
6     @io, @client, @bytes_left = io, client, max
7   end
9   def <<(buf)
10     if (@bytes_left -= buf.size) < 0
11       @io.close
12       @client.err_413("chunked request body too big")
13     end
14     @io << buf
15   end
17   def gets; @io.gets; end
18   def each(&block); @io.each(&block); end
19   def size; @io.size; end
20   def rewind; @io.rewind; end
21   def read(*args); @io.read(*args); end
22 end