class WebSocket::Driver::Hybi

def check_frame_length

def check_frame_length
  length = @message ? @message.data.bytesize : 0
  if length + @frame.length > @max_length
    fail(:too_large, 'WebSocket frame length too large')
    false
  else
    true
  end
end