'Handles a new request.
:param ip:      The IP of the client.
:param port:    The port of the client.
:param packet:  The packet.'

def _handle_new_request(self, ip, port, packet):

    if (packet['opcode'] != OPCODE_RRQ):
        self._logger.error(u'Unexpected    request    from    %s:%s,    opcode=%s:    packet=%s', ip, port, packet['opcode'], repr(packet))
        return
    if ('options' not in packet):
        self._logger.error(u"No    'options'    in    request    from    %s:%s,    opcode=%s,    packet=%s", ip, port, packet['opcode'], repr(packet))
        return
    if (('blksize' not in packet['options']) or ('timeout' not in packet['options'])):
        self._logger.error(u"No    'blksize'    or    'timeout'    not    in    'options'    from    %s:%s,    opcode=%s,    packet=%s", ip, port, packet['opcode'], repr(packet))
        return
    file_name = packet['file_name'].decode('utf8')
    block_size = packet['options']['blksize']
    timeout = packet['options']['timeout']
    if ((ip, port, packet['session_id']) in self._session_dict):
        self._logger.warn(u'Existing    session_id    %s    from    %s:%s', packet['session_id'], ip, port)
        dummy_session = Session(False, packet['session_id'], (ip, port), packet['opcode'], file_name, None, None, None, block_size=block_size, timeout=timeout)
        self._handle_error(dummy_session, 50)
        return
    try:
        if file_name.startswith(METADATA_PREFIX):
            if (not self.session.config.get_metadata_enabled()):
                return
            (file_data, file_size) = self._load_metadata(file_name[len(METADATA_PREFIX):])
        else:
            if (not self.session.config.get_torrent_store_enabled()):
                return
            (file_data, file_size) = self._load_torrent(file_name)
        checksum = b64encode(sha1(file_data).digest())
    except FileNotFound as e:
        self._logger.warn(u'[READ    %s:%s]    file    not    found:    %s', ip, port, e)
        dummy_session = Session(False, packet['session_id'], (ip, port), packet['opcode'], file_name, None, None, None, block_size=block_size, timeout=timeout)
        self._handle_error(dummy_session, 1)
        return
    except Exception as e:
        self._logger.error(u'[READ    %s:%s]    failed    to    load    file:    %s', ip, port, e)
        dummy_session = Session(False, packet['session_id'], (ip, port), packet['opcode'], file_name, None, None, None, block_size=block_size, timeout=timeout)
        self._handle_error(dummy_session, 2)
        raise
    session = Session(False, packet['session_id'], (ip, port), packet['opcode'], file_name, file_data, file_size, checksum, block_size=block_size, timeout=timeout)
    self._add_new_session(session)
    self._logger.debug(u'got    new    request:    %s', session)
    self._send_oack_packet(session)
