Method: Protocol::HTTP2::SettingsFrame#read_payload

Defined in:
lib/protocol/http2/settings_frame.rb

#read_payload(stream) ⇒ Object



250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/protocol/http2/settings_frame.rb', line 250

def read_payload(stream)
  super
  
  if @stream_id != 0
    raise ProtocolError, "Settings apply to connection only, but stream_id was given"
  end
  
  if acknowledgement? and @length != 0
    raise FrameSizeError, "Settings acknowledgement must not contain payload: #{@payload.inspect}"
  end
  
  if (@length % 6) != 0
    raise FrameSizeError, "Invalid frame length"
  end
end