'Handles the sender-side of the MISSING_CHECK step of a
SSYNC request.
Full documentation of this can be found at
:py:meth:`.Receiver.missing_check`.'

def missing_check(self):

    with exceptions.MessageTimeout(self.daemon.node_timeout, 'missing_check    start'):
        msg = ':MISSING_CHECK:    START\r\n'
        self.connection.send(('%x\r\n%s\r\n' % (len(msg), msg)))
    hash_gen = self.df_mgr.yield_hashes(self.job['device'], self.job['partition'], self.job['policy'], self.suffixes, frag_index=self.job.get('frag_index'))
    if (self.remote_check_objs is not None):
        hash_gen = six.moves.filter((lambda objhash_timestamps: (objhash_timestamps[0] in self.remote_check_objs)), hash_gen)
    for (object_hash, timestamps) in hash_gen:
        self.available_map[object_hash] = timestamps
        with exceptions.MessageTimeout(self.daemon.node_timeout, 'missing_check    send    line'):
            msg = ('%s\r\n' % encode_missing(object_hash, **timestamps))
            self.connection.send(('%x\r\n%s\r\n' % (len(msg), msg)))
    with exceptions.MessageTimeout(self.daemon.node_timeout, 'missing_check    end'):
        msg = ':MISSING_CHECK:    END\r\n'
        self.connection.send(('%x\r\n%s\r\n' % (len(msg), msg)))
    while True:
        with exceptions.MessageTimeout(self.daemon.http_timeout, 'missing_check    start    wait'):
            line = self.readline()
        if (not line):
            raise exceptions.ReplicationException('Early    disconnect')
        line = line.strip()
        if (line == ':MISSING_CHECK:    START'):
            break
        elif line:
            raise exceptions.ReplicationException(('Unexpected    response:    %r' % line[:1024]))
    while True:
        with exceptions.MessageTimeout(self.daemon.http_timeout, 'missing_check    line    wait'):
            line = self.readline()
        if (not line):
            raise exceptions.ReplicationException('Early    disconnect')
        line = line.strip()
        if (line == ':MISSING_CHECK:    END'):
            break
        parts = line.split()
        if parts:
            self.send_map[parts[0]] = decode_wanted(parts[1:])
