Class: Baykit::BayServer::Docker::Http::H2::H2Packet
- Inherits:
-
Protocol::Packet
- Object
- Protocol::Packet
- Baykit::BayServer::Docker::Http::H2::H2Packet
show all
- Includes:
- Baykit::BayServer::Docker::Http::H2, Protocol
- Defined in:
- lib/baykit/bayserver/docker/http/h2/h2_packet.rb
Defined Under Namespace
Classes: H2DataAccessor, H2HeaderAccessor
Constant Summary
collapse
- MAX_PAYLOAD_LEN =
2^24-1 = 16777215 = 16MB-1
0x00FFFFFF
- DEFAULT_PAYLOAD_MAXLEN =
0x00004000
9
- NO_ERROR =
0x0
- PROTOCOL_ERROR =
0x1
- INTERNAL_ERROR =
0x2
- FLOW_CONTROL_ERROR =
0x3
- SETTINGS_TIMEOUT =
0x4
- STREAM_CLOSED =
0x5
- FRAME_SIZE_ERROR =
0x6
- REFUSED_STREAM =
0x7
- CANCEL =
0x8
- COMPRESSION_ERROR =
0x9
- CONNECT_ERROR =
0xa
- ENHANCE_YOUR_CALM =
0xb
- INADEQUATE_SECURITY =
0xc
- HTTP_1_1_REQUIRED =
0xd
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(type) ⇒ H2Packet
Returns a new instance of H2Packet.
150
151
152
153
154
|
# File 'lib/baykit/bayserver/docker/http/h2/h2_packet.rb', line 150
def initialize(type)
super(type, , DEFAULT_PAYLOAD_MAXLEN)
@flags = H2Flags::FLAGS_NONE
@stream_id = -1
end
|
Instance Attribute Details
#flags ⇒ Object
Returns the value of attribute flags.
147
148
149
|
# File 'lib/baykit/bayserver/docker/http/h2/h2_packet.rb', line 147
def flags
@flags
end
|
#stream_id ⇒ Object
Returns the value of attribute stream_id.
148
149
150
|
# File 'lib/baykit/bayserver/docker/http/h2/h2_packet.rb', line 148
def stream_id
@stream_id
end
|
Class Method Details
.consolidate_flag_and_int32(flag, val) ⇒ Object
186
187
188
|
# File 'lib/baykit/bayserver/docker/http/h2/h2_packet.rb', line 186
def self.consolidate_flag_and_int32(flag, val)
((flag & 1) << 31) | (val & 0x7FFFFFFF)
end
|
182
183
184
|
# File 'lib/baykit/bayserver/docker/http/h2/h2_packet.rb', line 182
def self.(val)
(val & 0x80000000) >> 31 & 1
end
|
178
179
180
|
# File 'lib/baykit/bayserver/docker/http/h2/h2_packet.rb', line 178
def self.(val)
val & 0x7FFFFFFF
end
|
.make_stream_dependency32(excluded, dep) ⇒ Object
190
191
192
|
# File 'lib/baykit/bayserver/docker/http/h2/h2_packet.rb', line 190
def self.make_stream_dependency32(excluded, dep)
(excluded ? 1 : 0) << 31 | (dep)
end
|
Instance Method Details
#new_h2_data_accessor ⇒ Object
174
175
176
|
# File 'lib/baykit/bayserver/docker/http/h2/h2_packet.rb', line 174
def new_h2_data_accessor
H2DataAccessor.new(self, , -1)
end
|
170
171
172
|
# File 'lib/baykit/bayserver/docker/http/h2/h2_packet.rb', line 170
def
.new(self, 0, )
end
|
162
163
164
165
166
167
168
|
# File 'lib/baykit/bayserver/docker/http/h2/h2_packet.rb', line 162
def
acc = ()
acc.put_int24(data_len())
acc.put_byte(@type)
acc.put_byte(@flags.flags)
acc.put_int(H2Packet.(stream_id))
end
|
#reset ⇒ Object
156
157
158
159
160
|
# File 'lib/baykit/bayserver/docker/http/h2/h2_packet.rb', line 156
def reset
@flags = H2Flags::FLAGS_NONE
@stream_id = -1
super
end
|
#to_s ⇒ Object
194
195
196
|
# File 'lib/baykit/bayserver/docker/http/h2/h2_packet.rb', line 194
def to_s
"H2Packet(#{@type}) headerLen=#{@header_len} dataLen=#{data_len()} stm=#{@stream_id} flags=#{@flags}"
end
|