Class: Yahns::CapInput
Overview
This is used as the @input/env when input_buffering == true or :lazy
Instance Attribute Summary collapse
-
#bytes_left ⇒ Object
writeonly
:nodoc:.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#bytes_left=(value) ⇒ Object (writeonly)
:nodoc:
9 10 11 |
# File 'lib/yahns/cap_input.rb', line 9 def bytes_left=(value) @bytes_left = value end |
Class Method Details
.new(limit, tmpdir) ⇒ Object
11 12 13 14 15 |
# File 'lib/yahns/cap_input.rb', line 11 def self.new(limit, tmpdir) rv = super(tmpdir) rv.bytes_left = limit rv end |
Instance Method Details
#write(buf) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/yahns/cap_input.rb', line 17 def write(buf) if (@bytes_left -= buf.size) < 0 raise Unicorn::RequestEntityTooLargeError, "chunked body too big", [] end super(buf) end |