blob: c7794a9661c709ad60f0475adc14da9ececd91c9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
# frozen-string-literal: true
using Plum::BinaryString
module Plum
class Frame::RstStream < Frame
register_subclass 0x03
# Creates a RST_STREAM frame.
# @param stream_id [Integer] The stream ID.
# @param error_type [Symbol] The error type defined in RFC 7540 Section 7.
def initialize(stream_id, error_type)
payload = "".b.push_uint32(HTTPError::ERROR_CODES[error_type])
initialize_base(type: :rst_stream, stream_id: stream_id, payload: payload)
end
end
end
|