getncchanges.c: Refactor how objects get added to the response
commit63818f022fc882af926a008dbd8fac952529c0fe
authorTim Beale <timbeale@catalyst.net.nz>
Tue, 22 Aug 2017 04:17:10 +0000 (22 16:17 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Fri, 15 Sep 2017 04:18:12 +0000 (15 06:18 +0200)
tree2f66055686adee5aaffc881f03480a098e07c4f1
parentf77d55f1be41fabc30c9d278f855d6fef4f23924
getncchanges.c: Refactor how objects get added to the response

Adding GET_TGT support is going to make things more complicated, and I
think we are going to struggle to do this without refactoring things a
bit.

This patch adds a helper struct to store state related to a single
GetNCChanges chunk. I plan to add to this with things like max_links,
max_objects, etc, which will cutdown on the number of variables/
parameters we pass around.

I found the double-pointer logic where we add objects to the response
confusing - hopefully this refactor simplifies things slightly, and it
allows us to reuse the code for the GET_TGT case.

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