svn commit: samba r14060 - branches/SAMBA_3_0/source/lib trunk/source/lib

gd at samba.org gd at samba.org
Thu Mar 9 09:08:12 GMT 2006


Author: gd
Date: 2006-03-09 09:08:11 +0000 (Thu, 09 Mar 2006)
New Revision: 14060

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14060

Log:
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

Modified:
   branches/SAMBA_3_0/source/lib/smbldap.c
   trunk/source/lib/smbldap.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/smbldap.c
===================================================================
--- branches/SAMBA_3_0/source/lib/smbldap.c	2006-03-09 03:52:10 UTC (rev 14059)
+++ branches/SAMBA_3_0/source/lib/smbldap.c	2006-03-09 09:08:11 UTC (rev 14060)
@@ -853,9 +853,28 @@
 	    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;
 }
 #endif /*defined(LDAP_API_FEATURE_X_OPENLDAP) && (LDAP_API_VERSION > 2000)*/

Modified: trunk/source/lib/smbldap.c
===================================================================
--- trunk/source/lib/smbldap.c	2006-03-09 03:52:10 UTC (rev 14059)
+++ trunk/source/lib/smbldap.c	2006-03-09 09:08:11 UTC (rev 14060)
@@ -853,9 +853,28 @@
 	    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;
 }
 #endif /*defined(LDAP_API_FEATURE_X_OPENLDAP) && (LDAP_API_VERSION > 2000)*/



More information about the samba-cvs mailing list