aboutsummaryrefslogtreecommitdiffstats
path: root/lib/plum/frame/continuation.rb
blob: 1c5232c4f73d7e4a5d4759affc111ba5bcc8a3de (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::Continuation < Frame
    register_subclass 0x09

    # Creates a CONTINUATION frame.
    # @param stream_id [Integer] The stream ID.
    # @param payload [String] Payload.
    # @param end_headers [Boolean] add END_HEADERS flag
    def initialize(stream_id, payload, end_headers: false)
      initialize_base(type: :continuation, stream_id: stream_id, flags_value: (end_headers ? 4 : 0), payload: payload)
    end
  end
end