]> git.sur5r.net Git - openldap/commitdiff
Sync replication config option format change (interval)
authorJong Hyuk Choi <jongchoi@openldap.org>
Thu, 28 Aug 2003 22:29:12 +0000 (22:29 +0000)
committerJong Hyuk Choi <jongchoi@openldap.org>
Thu, 28 Aug 2003 22:29:12 +0000 (22:29 +0000)
servers/slapd/config.c
tests/data/slapd-syncrepl-slave-refresh1.conf
tests/data/slapd-syncrepl-slave-refresh2.conf
tests/scripts/test017-syncreplication-refresh
tests/scripts/test020-syncreplication-cascading

index 5f072309dbeb6fe9b23cda6ef9c8d34b3fe4d2e8..64a29bef4ad7345b6d555775eba49ba4fbea873c 100644 (file)
@@ -3001,10 +3001,31 @@ parse_syncrepl_line(
                } else if ( !strncasecmp( cargv[ i ],
                                INTERVALSTR, sizeof( INTERVALSTR ) - 1 ) ) {
                        val = cargv[ i ] + sizeof( INTERVALSTR );
-                       if ( si->type == LDAP_SYNC_REFRESH_AND_PERSIST )
+                       if ( si->type == LDAP_SYNC_REFRESH_AND_PERSIST ) {
                                si->interval = 0;
-                       else
-                               si->interval = atoi( val );
+                       } else {
+                               char *dstr;
+                               char *hstr;
+                               char *mstr;
+                               dstr = val;
+                               hstr = strchr( dstr, ':' );
+                               if ( hstr == NULL ) {
+                                       fprintf( stderr, "Error: parse_syncrepl_line: "
+                                                                        "invalid interval \"%s\"\n", val );
+                                       return 1;
+                               }
+                               *hstr++ = '\0';
+                               mstr = strchr( hstr, ':' );
+                               if ( mstr == NULL ) {
+                                       fprintf( stderr, "Error: parse_syncrepl_line: "
+                                                                        "invalid interval \"%s\"\n", val );
+                                       return 1;
+                               }
+                               *mstr++ = '\0';
+                               si->interval = (( atoi( dstr ) * 24 + atoi( hstr )) * 60
+                                                               + atoi( mstr )) * 60;
+                               fprintf(stderr, "interval = %d\n", si->interval );
+                       }
                        if ( si->interval < 0 ) {
                                fprintf( stderr, "Error: parse_syncrepl_line: "
                                                                 "invalid interval \"%ld\"\n",
index fdb41f096f6280c9c6932ed466d9e7117d082aa9..b1279c835ec615179f6ca1b4ede5408d7dae7fc1 100644 (file)
@@ -42,4 +42,4 @@ syncrepl id=1
                 lastmod=req
                 scope=sub
                 type=refreshOnly
-                interval=10
+                interval=00:00:01
index a6bdc14a27939c827903ba316ba78495edc53963..64f66f07cc3abc0099ff5af3dbeaab3f056dfe1c 100644 (file)
@@ -42,4 +42,4 @@ syncrepl id=1
                 lastmod=req
                 scope=sub
                 type=refreshOnly
-                interval=10
+                interval=00:00:01
index ff173ee1f1c1e78e71ac4d86798c5c542c102e33..3f1d42e27d5a0999a8f7e30bc41167acfea61b31 100755 (executable)
@@ -94,8 +94,8 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
-echo "Waiting 30 seconds for syncrepl to receive changes..."
-sleep 30
+echo "Waiting 90 seconds for syncrepl to receive changes..."
+sleep 90
 
 echo "Using ldapmodify to modify master directory..."
 
@@ -176,8 +176,8 @@ changetype: delete
 
 EOMODS
 
-echo "Waiting 30 seconds for syncrepl to receive changes..."
-sleep 30
+echo "Waiting 90 seconds for syncrepl to receive changes..."
+sleep 90
 
 echo "Using ldapsearch to read all the entries from the master..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
index e84d59528146f800b8cf4e9beb06abd48720a51e..6ffb6852c6d33a0c587554ccd70c8c75c35ae862 100755 (executable)
@@ -205,8 +205,8 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
-echo "Waiting 60 seconds for syncrepl to receive changes..."
-sleep 60
+echo "Waiting 90 seconds for syncrepl to receive changes..."
+sleep 90
 
 echo "Using ldapmodify to modify master directory..."
 
@@ -287,8 +287,8 @@ changetype: delete
 
 EOMODS
 
-echo "Waiting 60 seconds for syncrepl to receive changes..."
-sleep 60
+echo "Waiting 90 seconds for syncrepl to receive changes..."
+sleep 90
 
 echo "Using ldapsearch to read all the entries from the master..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \