Skip to content

Commit b75c0f7

Browse files
Apply suggestions from code review
Co-authored-by: Samuel Williams <samuel.williams@shopify.com>
1 parent 7be17b5 commit b75c0f7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/protocol/websocket/framer.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def flush
4747
# Read a frame from the underlying stream.
4848
# @returns [Frame] the frame read from the stream.
4949
def read_frame(maximum_frame_size = MAXIMUM_ALLOWED_FRAME_SIZE)
50+
# Read the header bytes from the stream:
5051
buffer = @stream.read(2)
5152

5253
unless buffer and buffer.bytesize == 2
@@ -65,6 +66,7 @@ def read_frame(maximum_frame_size = MAXIMUM_ALLOWED_FRAME_SIZE)
6566
raise ProtocolError, "Control opcode = #{opcode} is reserved!"
6667
end
6768

69+
# Read the frame:
6870
klass = @frames[opcode] || Frame
6971
frame = klass.read(finished, flags, opcode, @stream, maximum_frame_size, buffer.getbyte(1))
7072

0 commit comments

Comments
 (0)