class WebSocket::Driver::Hybi

def parse_extended_length(buffer)

def parse_extended_length(buffer)
  @frame.length = buffer.unpack(PACK_FORMATS[buffer.bytesize]).first
  @stage = @frame.masked ? 3 : 4
  unless MESSAGE_OPCODES.include?(@frame.opcode) or @frame.length <= 125
    return fail(:protocol_error, "Received control frame having too long payload: #{ @frame.length }")
  end
  return unless check_frame_length
end