'Send the latest cluster configuration and state to ``connection``.
:param ControlAMP connection: The connection to use to send the
command.'

def _update_connection(self, connection, configuration, state):

    self._configuration_generation_tracker.insert_latest(configuration)
    self._state_generation_tracker.insert_latest(state)
    action = LOG_SEND_TO_AGENT(agent=connection)
    with action.context():
        last_received_generations = self._last_received_generation[connection]
        config_gen_tracker = self._configuration_generation_tracker
        configuration_diff = config_gen_tracker.get_diff_from_hash_to_latest(last_received_generations.config_hash)
        state_gen_tracker = self._state_generation_tracker
        state_diff = state_gen_tracker.get_diff_from_hash_to_latest(last_received_generations.state_hash)
        if ((configuration_diff is not None) and (state_diff is not None)):
            d = DeferredContext(maybeDeferred(connection.callRemote, ClusterStatusDiffCommand, configuration_diff=configuration_diff, start_configuration_generation=last_received_generations.config_hash, end_configuration_generation=config_gen_tracker.get_latest_hash(), state_diff=state_diff, start_state_generation=last_received_generations.state_hash, end_state_generation=state_gen_tracker.get_latest_hash(), eliot_context=action))
            d.addActionFinish()
        else:
            configuration = config_gen_tracker.get_latest()
            state = state_gen_tracker.get_latest()
            d = DeferredContext(maybeDeferred(connection.callRemote, ClusterStatusCommand, configuration=configuration, configuration_generation=config_gen_tracker.get_latest_hash(), state=state, state_generation=state_gen_tracker.get_latest_hash(), eliot_context=action))
            d.addActionFinish()
        d.result.addErrback((lambda _: None))
    update = self._current_command[connection] = _UpdateState(response=d.result, next_scheduled=False)
    def finished_update(response):
        del self._current_command[connection]
        if response:
            config_gen = response['current_configuration_generation']
            state_gen = response['current_state_generation']
            self._last_received_generation[connection] = _ConfigAndStateGeneration(config_hash=config_gen, state_hash=state_gen)
            if ((self._configuration_generation_tracker.get_latest_hash() != config_gen) or (self._state_generation_tracker.get_latest_hash() != state_gen)):
                self._schedule_update([connection])
    update.response.addCallback(finished_update)
