Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/replication
In directory
cvs1.fedora.phx.redhat.com:/tmp/cvs-serv10769/ldap/servers/plugins/replication
Modified Files:
windows_protocol_util.c
Log Message:
Resolves: 381361
Summary: Optimized fetching of remote entry when checking if a rename is needed with
winsync.
Index: windows_protocol_util.c
===================================================================
RCS file:
/cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_protocol_util.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- windows_protocol_util.c 9 Jan 2009 17:24:29 -0000 1.46
+++ windows_protocol_util.c 9 Jan 2009 18:11:41 -0000 1.47
@@ -1758,7 +1758,15 @@
* against the existing remote value. We only need to do
* this once for all mods. */
if (!got_entry) {
- windows_get_remote_entry(prp, remote_dn, &remote_entry);
+ int free_entry = 0;
+
+ /* See if we have already fetched the remote entry.
+ * If not, we just fetch it ourselves. */
+ if ((remote_entry = windows_private_get_raw_entry(prp->agmt)) == NULL) {
+ windows_get_remote_entry(prp, remote_dn, &remote_entry);
+ free_entry = 1;
+ }
+
if (remote_entry) {
/* Fetch and duplicate the cn attribute so we can perform comparisions */
slapi_entry_attr_find(remote_entry, "cn", &remote_rdn_attr);
@@ -1766,7 +1774,12 @@
remote_rdn_attr = slapi_attr_dup(remote_rdn_attr);
slapi_attr_first_value(remote_rdn_attr, &remote_rdn_val);
}
- slapi_entry_free(remote_entry);
+
+ /* We only want to free the entry if we fetched it ourselves
+ * by calling windows_get_remote_entry(). */
+ if (free_entry) {
+ slapi_entry_free(remote_entry);
+ }
}
got_entry = 1;