Class: Baykit::BayServer::Docker::Http::H2::HeaderBlockParser

Inherits:
Object
  • Object
show all
Includes:
Huffman, Util
Defined in:
lib/baykit/bayserver/docker/http/h2/header_block_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(buf, start, length) ⇒ HeaderBlockParser



21
22
23
24
25
26
# File 'lib/baykit/bayserver/docker/http/h2/header_block_parser.rb', line 21

def initialize(buf, start, length)
  @buf = buf
  @start = start
  @pos = 0
  @length = length
end

Instance Attribute Details

#bufObject (readonly)

Returns the value of attribute buf.



15
16
17
# File 'lib/baykit/bayserver/docker/http/h2/header_block_parser.rb', line 15

def buf
  @buf
end

#lengthObject (readonly)

Returns the value of attribute length.



18
19
20
# File 'lib/baykit/bayserver/docker/http/h2/header_block_parser.rb', line 18

def length
  @length
end

#posObject (readonly)

Returns the value of attribute pos.



17
18
19
# File 'lib/baykit/bayserver/docker/http/h2/header_block_parser.rb', line 17

def pos
  @pos
end

#startObject (readonly)

Returns the value of attribute start.



16
17
18
# File 'lib/baykit/bayserver/docker/http/h2/header_block_parser.rb', line 16

def start
  @start
end

Instance Method Details

#parse_header_blocksObject



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/baykit/bayserver/docker/http/h2/header_block_parser.rb', line 28

def parse_header_blocks

  header_blocks = []

  while @pos < @length
    blk = parse_header_block()
    BayLog.trace("h2: header block read: %s", blk)
    header_blocks << blk
  end

  return header_blocks
end