Method: Protocol::HTTP2::Continued#read

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

#read(stream, maximum_frame_size) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/protocol/http2/continuation_frame.rb', line 36

def read(stream, maximum_frame_size)
	super
	
	unless end_headers?
		continuation = ContinuationFrame.new
		continuation.read_header(stream)
		
		# We validate the frame type here:
		unless continuation.valid_type?
			raise ProtocolError, "Invalid frame type: #{@type}!"
		end
		
		if continuation.stream_id != @stream_id
			raise ProtocolError, "Invalid stream id: #{continuation.stream_id} for continuation of stream id: #{@stream_id}!"
		end
		
		continuation.read(stream, maximum_frame_size)
		
		@continuation = continuation
	end
end