'Handles the sender-side of the UPDATES step of an SSYNC
request.
Full documentation of this can be found at
:py:meth:`.Receiver.updates`.'

def updates(self):

    with exceptions.MessageTimeout(self.daemon.node_timeout, 'updates    start'):
        msg = ':UPDATES:    START\r\n'
        self.connection.send(('%x\r\n%s\r\n' % (len(msg), msg)))
    for (object_hash, want) in self.send_map.items():
        object_hash = urllib.parse.unquote(object_hash)
        try:
            df = self.df_mgr.get_diskfile_from_hash(self.job['device'], self.job['partition'], object_hash, self.job['policy'], frag_index=self.job.get('frag_index'))
        except exceptions.DiskFileNotExist:
            continue
        url_path = urllib.parse.quote(('/%s/%s/%s' % (df.account, df.container, df.obj)))
        try:
            df.open()
            if want.get('data'):
                df_alt = self.job.get('sync_diskfile_builder', (lambda *args: df))(self.job, self.node, df.get_datafile_metadata())
                self.send_put(url_path, df_alt)
            if (want.get('meta') and (df.data_timestamp != df.timestamp)):
                self.send_post(url_path, df)
        except exceptions.DiskFileDeleted as err:
            if want.get('data'):
                self.send_delete(url_path, err.timestamp)
        except exceptions.DiskFileError:
            pass
    with exceptions.MessageTimeout(self.daemon.node_timeout, 'updates    end'):
        msg = ':UPDATES:    END\r\n'
        self.connection.send(('%x\r\n%s\r\n' % (len(msg), msg)))
    while True:
        with exceptions.MessageTimeout(self.daemon.http_timeout, 'updates    start    wait'):
            line = self.readline()
        if (not line):
            raise exceptions.ReplicationException('Early    disconnect')
        line = line.strip()
        if (line == ':UPDATES:    START'):
            break
        elif line:
            raise exceptions.ReplicationException(('Unexpected    response:    %r' % line[:1024]))
    while True:
        with exceptions.MessageTimeout(self.daemon.http_timeout, 'updates    line    wait'):
            line = self.readline()
        if (not line):
            raise exceptions.ReplicationException('Early    disconnect')
        line = line.strip()
        if (line == ':UPDATES:    END'):
            break
        elif line:
            raise exceptions.ReplicationException(('Unexpected    response:    %r' % line[:1024]))
