rainbows.git  about / heads / tags
Unicorn for sleepy apps and slow clients
blob 5693eadc397f6249c9b82abdbc2cc522ed11d979 302 bytes (raw)
$ git show HEAD:lib/rainbows/max_body/rewindable_wrapper.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
 
# -*- encoding: binary -*-
# :enddoc:
class Rainbows::MaxBody::RewindableWrapper < Rainbows::MaxBody::Wrapper
  def initialize(rack_input, limit)
    @orig_limit = limit
    super
  end

  def rewind
    @limit = @orig_limit
    @rbuf = ''
    @input.rewind
  end

  def size
    @input.size
  end
end

git clone https://yhbt.net/rainbows.git