Class: Plum::HPACK::Decoder

Inherits:
Object
  • Object
show all
Includes:
Context
Defined in:
lib/plum/hpack/decoder.rb

Instance Attribute Summary

Attributes included from Context

#dynamic_table, #limit, #size

Instance Method Summary collapse

Constructor Details

#initialize(dynamic_table_limit) ⇒ Decoder

Returns a new instance of Decoder.


9
10
11
# File 'lib/plum/hpack/decoder.rb', line 9

def initialize(dynamic_table_limit)
  super
end

Instance Method Details

#decode(str) ⇒ Object


13
14
15
16
17
18
19
20
21
22
23
# File 'lib/plum/hpack/decoder.rb', line 13

def decode(str)
  headers = []
  pos = 0
  lpos = str.bytesize
  while pos < lpos
    l, succ = parse(str, pos)
    pos += succ
    headers << l if l
  end
  headers
end