lib/protocol/http2/window_update_frame.rb in protocol-http2-0.6.0 vs lib/protocol/http2/window_update_frame.rb in protocol-http2-0.7.0
- old
+ new
@@ -47,10 +47,11 @@
# When the value of SETTINGS_INITIAL_WINDOW_SIZE changes, a receiver MUST adjust the size of all stream flow-control windows that it maintains by the difference between the new value and the old value.
def capacity= value
difference = value - @capacity
@available += difference
+ @capacity = value
end
def consume(amount)
@available -= amount
@used += amount
@@ -61,9 +62,10 @@
def available?
@available > 0
end
def expand(amount)
+ # puts "expand(#{amount}) @available=#{@available}"
@available += amount
@used -= amount
if @available > MAXIMUM_ALLOWED_WINDOW_SIZE
raise FlowControlError, "Expanding window by #{amount} caused overflow: #{@available} > #{MAXIMUM_ALLOWED_WINDOW_SIZE}!"