]> git.sur5r.net Git - openldap/commitdiff
revert pervious change
authorJong Hyuk Choi <jongchoi@openldap.org>
Fri, 18 Jun 2004 02:59:47 +0000 (02:59 +0000)
committerJong Hyuk Choi <jongchoi@openldap.org>
Fri, 18 Jun 2004 02:59:47 +0000 (02:59 +0000)
servers/slapd/config.c

index a144b6cd570bf8f39bae66a85f9c068051c853e4..7aceee21eb25fd94d5a8701df5cc7a506ad1bd6e 100644 (file)
@@ -3332,48 +3332,51 @@ 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 );
-                       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;
+                       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;
                        }
-                       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",