mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
second level interval support, interval=dd:hh:mm:ss
changed the test scripts and test conf files accordingly
This commit is contained in:
parent
f8fe312a16
commit
cc5e417234
@ -3053,28 +3053,51 @@ parse_syncrepl_line(
|
||||
} else if ( !strncasecmp( cargv[ i ],
|
||||
INTERVALSTR, sizeof( INTERVALSTR ) - 1 ) )
|
||||
{
|
||||
char *hstr;
|
||||
char *mstr;
|
||||
char *dstr;
|
||||
val = cargv[ i ] + sizeof( INTERVALSTR );
|
||||
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->si_interval = (( atoi( dstr ) * 24 + atoi( hstr )) * 60
|
||||
+ atoi( mstr )) * 60;
|
||||
if ( si->si_type == LDAP_SYNC_REFRESH_AND_PERSIST ) {
|
||||
si->si_interval = 0;
|
||||
} else {
|
||||
char *hstr;
|
||||
char *mstr;
|
||||
char *dstr;
|
||||
char *sstr;
|
||||
int dd, hh, mm, ss;
|
||||
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';
|
||||
sstr = strchr( mstr, ':' );
|
||||
if ( sstr == NULL ) {
|
||||
fprintf( stderr, "Error: parse_syncrepl_line: "
|
||||
"invalid interval \"%s\"\n", val );
|
||||
return 1;
|
||||
}
|
||||
*sstr++ = '\0';
|
||||
|
||||
dd = atoi( dstr );
|
||||
hh = atoi( hstr );
|
||||
mm = atoi( mstr );
|
||||
ss = atoi( sstr );
|
||||
if (( hh > 24 ) || ( hh < 0 ) ||
|
||||
( mm > 60 ) || ( mm < 0 ) ||
|
||||
( ss > 60 ) || ( ss < 0 ) || ( dd < 0 )) {
|
||||
fprintf( stderr, "Error: parse_syncrepl_line: "
|
||||
"invalid interval \"%s\"\n", val );
|
||||
return 1;
|
||||
}
|
||||
si->si_interval = (( dd * 24 + hh ) * 60 + mm ) * 60 + ss;
|
||||
}
|
||||
if ( si->si_interval < 0 ) {
|
||||
fprintf( stderr, "Error: parse_syncrepl_line: "
|
||||
"invalid interval \"%ld\"\n",
|
||||
|
@ -42,4 +42,4 @@ syncrepl id=1
|
||||
schemachecking=off
|
||||
scope=sub
|
||||
type=refreshOnly
|
||||
interval=00:00:01
|
||||
interval=00:00:00:10
|
||||
|
@ -42,4 +42,4 @@ syncrepl id=1
|
||||
schemachecking=off
|
||||
scope=sub
|
||||
type=refreshOnly
|
||||
interval=00:00:01
|
||||
interval=00:00:00:10
|
||||
|
@ -91,8 +91,8 @@ if test $RC != 0 ; then
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
echo "Waiting 90 seconds for syncrepl to receive changes..."
|
||||
sleep 90
|
||||
echo "Waiting 15 seconds for syncrepl to receive changes..."
|
||||
sleep 15
|
||||
|
||||
echo "Using ldapmodify to modify master directory..."
|
||||
|
||||
@ -180,8 +180,8 @@ if test $RC != 0 ; then
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
echo "Waiting 90 seconds for syncrepl to receive changes..."
|
||||
sleep 90
|
||||
echo "Waiting 15 seconds for syncrepl to receive changes..."
|
||||
sleep 15
|
||||
|
||||
echo "Using ldapsearch to read all the entries from the master..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
|
||||
|
@ -91,8 +91,8 @@ if test $RC != 0 ; then
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
echo "Waiting 20 seconds for syncrepl to receive changes..."
|
||||
sleep 20
|
||||
echo "Waiting 15 seconds for syncrepl to receive changes..."
|
||||
sleep 15
|
||||
|
||||
echo "Using ldapmodify to modify master directory..."
|
||||
|
||||
@ -180,8 +180,8 @@ if test $RC != 0 ; then
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
echo "Waiting 20 seconds for syncrepl to receive changes..."
|
||||
sleep 20
|
||||
echo "Waiting 15 seconds for syncrepl to receive changes..."
|
||||
sleep 15
|
||||
|
||||
echo "Using ldapsearch to read all the entries from the master..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
|
||||
|
@ -203,8 +203,8 @@ if test $RC != 0 ; then
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
echo "Waiting 90 seconds for syncrepl to receive changes..."
|
||||
sleep 90
|
||||
echo "Waiting 25 seconds for syncrepl to receive changes..."
|
||||
sleep 25
|
||||
|
||||
echo "Using ldapmodify to modify master directory..."
|
||||
|
||||
@ -292,8 +292,8 @@ if test $RC != 0 ; then
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
echo "Waiting 90 seconds for syncrepl to receive changes..."
|
||||
sleep 90
|
||||
echo "Waiting 25 seconds for syncrepl to receive changes..."
|
||||
sleep 25
|
||||
|
||||
echo "Using ldapsearch to read all the entries from the master..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
|
||||
|
Loading…
Reference in New Issue
Block a user