From bd765b849d68e2c13fd31f24c0be6e21403c09d1 Mon Sep 17 00:00:00 2001
From: Kurt Zeilenga <kurt@openldap.org>
Date: Tue, 23 Mar 2004 01:12:11 +0000
Subject: [PATCH] ITS#2768: configuring slurpd's interval between replog checks
 based upon a patch submitted by Jason Townsend (Apple).

---
 doc/man/man5/slapd.conf.5 |  5 +++++
 servers/slapd/config.c    |  3 +++
 servers/slurpd/config.c   | 34 +++++++++++++++++++++++++++++++++-
 3 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/doc/man/man5/slapd.conf.5 b/doc/man/man5/slapd.conf.5
index eec4f0187b..ea2e985b11 100644
--- a/doc/man/man5/slapd.conf.5
+++ b/doc/man/man5/slapd.conf.5
@@ -625,6 +625,11 @@ server's process ID ( see
 .BR getpid (2)
 ) if started without the debugging command line option.
 .TP
+.B replicationinterval
+The number of seconds 
+.B slurpd 
+waits before checking the replogfile for changes.
+.TP
 .B require <conditions>
 Specify a set of conditions (separated by white space) to
 require (default none).
diff --git a/servers/slapd/config.c b/servers/slapd/config.c
index aa75227507..03ed198d51 100644
--- a/servers/slapd/config.c
+++ b/servers/slapd/config.c
@@ -1979,6 +1979,9 @@ read_config( const char *fname, int depth )
 				}
 			}
 
+		} else if ( strcasecmp( cargv[0], "replicationInterval" ) == 0 ) {
+			/* ignore */
+
 		/* dn of slave entity allowed to write to replica */
 		} else if ( strcasecmp( cargv[0], "updatedn" ) == 0 ) {
 			if ( cargc < 2 ) {
diff --git a/servers/slurpd/config.c b/servers/slurpd/config.c
index ffd08740ee..9e88115c1d 100644
--- a/servers/slurpd/config.c
+++ b/servers/slurpd/config.c
@@ -213,7 +213,39 @@ slurpd_read_config(
 
 		LUTIL_SLASHPATH( cargv[1] );
 		slurpd_args_file = ch_strdup( cargv[1] );
-	}
+
+		} else if ( strcasecmp( cargv[0], "replicationinterval" ) == 0 ) {
+			int c;
+			if ( cargc < 2 ) {
+#ifdef NEW_LOGGING
+				LDAP_LOG( CONFIG, CRIT, "%s: %d: missing interval in "
+					"\"replicationinterval <seconds>\" line.\n",
+					fname, lineno, 0 );
+#else
+				Debug( LDAP_DEBUG_ANY, "%s: line %d: missing interval in "
+					"\"replicationinterval <seconds>\" line\n",
+					fname, lineno, 0 );
+#endif
+				return( 1 );
+			}
+
+			c = atoi( cargv[1] );
+			if( c < 1 ) {
+#ifdef NEW_LOGGING
+				LDAP_LOG( CONFIG, CRIT, "%s: line %d: invalid interval "
+					"(%d) in \"replicationinterval <seconds>\" line\n",
+					fname, lineno, c );
+#else
+				Debug( LDAP_DEBUG_ANY, "%s: line %d: invalid interval "
+					"(%d) in \"replicationinterval <seconds>\" line\n",
+					fname, lineno, c );
+#endif
+
+				return( 1 );
+			}
+
+			sglob->no_work_interval = c;
+		}
     }
     fclose( fp );
 #ifdef NEW_LOGGING
-- 
GitLab