Sha256: e0351fe880a5dcecc4f4175a7b5e55b6f44de13edcc341a03475f712080da034

Contents?: true

Size: 480 Bytes

Versions: 2

Compression:

Stored size: 480 Bytes

Contents

# -*- encoding: binary -*-
# :enddoc:
class Rainbows::EvCore::CapInput

  def initialize(io, client, max)
    @io, @client, @bytes_left = io, client, max
  end

  def <<(buf)
    if (@bytes_left -= buf.size) < 0
      @io.close
      @client.err_413("chunked request body too big")
    end
    @io << buf
  end

  def gets; @io.gets; end
  def each(&block); @io.each(&block); end
  def size; @io.size; end
  def rewind; @io.rewind; end
  def read(*args); @io.read(*args); end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rainbows-3.0.0 lib/rainbows/ev_core/cap_input.rb
rainbows-2.1.0 lib/rainbows/ev_core/cap_input.rb