Class: Baykit::BayServer::Docker::Http::H2::HeaderBlockAnalyzer
- Inherits:
-
Object
- Object
- Baykit::BayServer::Docker::Http::H2::HeaderBlockAnalyzer
- Defined in:
- lib/baykit/bayserver/docker/http/h2/header_block_analyzer.rb
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#scheme ⇒ Object
readonly
Returns the value of attribute scheme.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#method ⇒ Object (readonly)
Returns the value of attribute method.
10 11 12 |
# File 'lib/baykit/bayserver/docker/http/h2/header_block_analyzer.rb', line 10 def method @method end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/baykit/bayserver/docker/http/h2/header_block_analyzer.rb', line 8 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
11 12 13 |
# File 'lib/baykit/bayserver/docker/http/h2/header_block_analyzer.rb', line 11 def path @path end |
#scheme ⇒ Object (readonly)
Returns the value of attribute scheme.
12 13 14 |
# File 'lib/baykit/bayserver/docker/http/h2/header_block_analyzer.rb', line 12 def scheme @scheme end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
13 14 15 |
# File 'lib/baykit/bayserver/docker/http/h2/header_block_analyzer.rb', line 13 def status @status end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
9 10 11 |
# File 'lib/baykit/bayserver/docker/http/h2/header_block_analyzer.rb', line 9 def value @value end |
Instance Method Details
#analyze_header_block(blk, tbl) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/baykit/bayserver/docker/http/h2/header_block_analyzer.rb', line 24 def analyze_header_block(blk, tbl) clear case blk.op when HeaderBlock::INDEX kv = tbl.get(blk.index) if kv == nil raise RuntimeError.new "Invalid header index: #{blk.index}" end @name = kv.name @value = kv.value when HeaderBlock::KNOWN_HEADER, HeaderBlock::OVERLOAD_KNOWN_HEADER kv = tbl.get(blk.index) if kv == nil raise RuntimeError.new "Invalid header index: #{blk.index}" end @name = kv.name @value = blk.value if blk.op == HeaderBlock::OVERLOAD_KNOWN_HEADER tbl.insert(@name, @value) end when HeaderBlock::NEW_HEADER @name = blk.name @value = blk.value tbl.insert(@name, @value) when HeaderBlock::UNKNOWN_HEADER @name = blk.name @value = blk.value when HeaderBlock::UPDATE_DYNAMIC_TABLE_SIZE tbl.set_size(blk.size) else raise RuntimeError.new("Illegal state") end if @name != nil && @name[0] == ":" case @name when HeaderTable::PSEUDO_HEADER_AUTHORITY @name = "host" when HeaderTable::PSEUDO_HEADER_METHOD @method = @value when HeaderTable::PSEUDO_HEADER_PATH @path = @value when HeaderTable::PSEUDO_HEADER_SCHEME @scheme = @value when HeaderTable::PSEUDO_HEADER_STATUS @status = @value end end end |
#clear ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/baykit/bayserver/docker/http/h2/header_block_analyzer.rb', line 15 def clear @name = nil @value = nil @method = nil @path = nil @scheme = nil @status = nil end |