]> git.sur5r.net Git - openldap/commitdiff
ITS#3064 don't reset sync interval to zero on PERSIST
authorHoward Chu <hyc@openldap.org>
Fri, 21 May 2004 23:53:14 +0000 (23:53 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 21 May 2004 23:53:14 +0000 (23:53 +0000)
servers/slapd/config.c

index 6964120e98d22e82fd5836679319bab4f77f070c..f2d3d225ddf415b51213794b5a69525e342701b6 100644 (file)
@@ -3310,51 +3310,48 @@ parse_syncrepl_line(
                } else if ( !strncasecmp( cargv[ i ],
                        INTERVALSTR, sizeof( INTERVALSTR ) - 1 ) )
                {
+                       char *hstr;
+                       char *mstr;
+                       char *dstr;
+                       char *sstr;
+                       int dd, hh, mm, ss;
                        val = cargv[ i ] + sizeof( INTERVALSTR );
-                       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;
+                       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",