diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-01-12 17:19:48 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:40:30 -0500 |
commit | 33f894664005544b80a6640c34dbf133edbe363d (patch) | |
tree | c0f5f1616de4c786ba11249aad88e75150a69ef4 /source4/dsdb/samdb | |
parent | cf5f76bf662ad471d68424938966364032527988 (diff) | |
download | samba-33f894664005544b80a6640c34dbf133edbe363d.tar.gz samba-33f894664005544b80a6640c34dbf133edbe363d.tar.bz2 samba-33f894664005544b80a6640c34dbf133edbe363d.zip |
r20713: sort the cursors in replUpToDateVector by source_dsa_invocation_id,
w2k3 seems to do the same.
It's later useful, when we would have a large array
be could use a binary search
metze
(This used to be commit cd654f20e16c32f82ceb2b66453ce8d1be7020dd)
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index 18713d7e19..ca0291affd 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -641,6 +641,12 @@ static int replmd_replicated_uptodate_modify_callback(struct ldb_context *ldb, #endif } +static int replmd_drsuapi_DsReplicaCursor2_compare(const struct drsuapi_DsReplicaCursor2 *c1, + const struct drsuapi_DsReplicaCursor2 *c2) +{ + return GUID_compare(&c1->source_dsa_invocation_id, &c2->source_dsa_invocation_id); +} + static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *ar) { NTSTATUS nt_status; @@ -823,6 +829,13 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a nuv.ctr.ctr2.count = ni; /* + * sort the cursors + */ + qsort(nuv.ctr.ctr2.cursors, nuv.ctr.ctr2.count, + sizeof(struct drsuapi_DsReplicaCursor2), + (comparison_fn_t)replmd_drsuapi_DsReplicaCursor2_compare); + + /* * create the change ldb_message */ msg = ldb_msg_new(ar->sub.mem_ctx); |