getncchanges.c: Refactor how we add ancestor links
authorTim Beale <timbeale@catalyst.net.nz>
Tue, 22 Aug 2017 04:00:57 +0000 (16:00 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Fri, 15 Sep 2017 04:18:12 +0000 (06:18 +0200)
commitf77d55f1be41fabc30c9d278f855d6fef4f23924
tree9a4d8d38472bb69b1115a648fa2b0cf869ff1c33
parent4057438e3b8db6291396d12701b52dea102d57c2
getncchanges.c: Refactor how we add ancestor links

If the current object had already been sent as an ancestor, we were
duplicating the code that added its links and updated the HWM mark.
We want these to occur when we reach the place where the object's USN
naturally occurs.

Instead of duplicating this code, we can just skip the call to
get_nc_changes_build_object() if the object has already been sent.
There is already an existing 'nothing to send'/continue case after we've
updated the highwater mark.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source4/rpc_server/drsuapi/getncchanges.c