lib/protocol/http2/settings_frame.rb in protocol-http2-0.6.0 vs lib/protocol/http2/settings_frame.rb in protocol-http2-0.7.0

- old
+ new

@@ -229,14 +229,19 @@ def connection? true end def unpack - super.scan(/....../).map{|s| s.unpack(FORMAT)} + if buffer = super + # TODO String#each_slice, or #each_unpack would be nice. + buffer.scan(/....../m).map{|s| s.unpack(FORMAT)} + else + [] + end end def pack(settings = []) - super settings.map{|s| s.pack(FORMAT)}.join + super(settings.map{|s| s.pack(FORMAT)}.join) end def apply(connection) connection.receive_settings(self) end