Sync replication config option format change (interval)

This commit is contained in:
Jong Hyuk Choi 2003-08-28 22:29:12 +00:00
parent 9760933c20
commit 5548a2dd0c
5 changed files with 34 additions and 13 deletions

View 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",

View file

@ -42,4 +42,4 @@ syncrepl id=1
lastmod=req
scope=sub
type=refreshOnly
interval=10
interval=00:00:01

View file

@ -42,4 +42,4 @@ syncrepl id=1
lastmod=req
scope=sub
type=refreshOnly
interval=10
interval=00:00:01

View file

@ -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 \

View file

@ -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 \