summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2006-03-09 09:08:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:11:09 -0500
commit1b0211ca131e2c568ee445e96c38e5ea67e2ddb6 (patch)
treeb5cd71714827da7658e5d2832da12a1e53d32101 /source3
parent16ea81ba7f3792b882bb83bcf7fa36b256b3107d (diff)
downloadsamba-1b0211ca131e2c568ee445e96c38e5ea67e2ddb6.tar.gz
samba-1b0211ca131e2c568ee445e96c38e5ea67e2ddb6.tar.bz2
samba-1b0211ca131e2c568ee445e96c38e5ea67e2ddb6.zip
r14060: Only set the last rebind timestamp when we did rebind after a non-read
LDAP operation. That way we avoid the replication sleep after a simple redirected search operation Guenther (This used to be commit d236caac211ff45a3e2da73a3b0316194740a722)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/smbldap.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c
index e54464a49b..327c5a7c4d 100644
--- a/source3/lib/smbldap.c
+++ b/source3/lib/smbldap.c
@@ -853,8 +853,27 @@ static int rebindproc_connect_with_state (LDAP *ldap_struct,
username and password to? */
rc = ldap_simple_bind_s(ldap_struct, ldap_state->bind_dn, ldap_state->bind_secret);
-
- GetTimeOfDay(&ldap_state->last_rebind);
+
+ /* only set the last rebind timestamp when we did rebind after a
+ * non-read LDAP operation. That way we avoid the replication sleep
+ * after a simple redirected search operation - Guenther */
+
+ switch (request) {
+
+ case LDAP_REQ_MODIFY:
+ case LDAP_REQ_ADD:
+ case LDAP_REQ_DELETE:
+ case LDAP_REQ_MODDN:
+ case LDAP_REQ_EXTENDED:
+ DEBUG(10,("rebindproc_connect_with_state: "
+ "setting last_rebind timestamp "
+ "(req: 0x%02x)\n", request));
+ GetTimeOfDay(&ldap_state->last_rebind);
+ break;
+ default:
+ ZERO_STRUCT(ldap_state->last_rebind);
+ break;
+ }
return rc;
}