File: lib/ruby-h2/http-agent.rb:265,278
Both methods use @streams.keys.last to find the highest existing stream ID. Ruby hashes maintain insertion order, not numerical order.
If streams are inserted out of numerical order (e.g. server creates push stream 2, receives client stream 3, creates push stream 4, then receives a delayed lower-numbered client stream), keys.last could return a stale value and generate a stream ID that was already used.
Fix: use @streams.keys.max instead.
File:
lib/ruby-h2/http-agent.rb:265,278Both methods use
@streams.keys.lastto find the highest existing stream ID. Ruby hashes maintain insertion order, not numerical order.If streams are inserted out of numerical order (e.g. server creates push stream 2, receives client stream 3, creates push stream 4, then receives a delayed lower-numbered client stream),
keys.lastcould return a stale value and generate a stream ID that was already used.Fix: use
@streams.keys.maxinstead.