} else {
for ( i = 1; i < cargc; i++ ) {
if ( strncasecmp( cargv[i], "suffix=", 7 ) == 0 ) {
- char *nsuffix = ch_strdup( cargv[i] + 7 );
- if ( dn_normalize( nsuffix ) != NULL ) {
- if ( select_backend( nsuffix, 0 ) == be ) {
- charray_add( &be->be_replica[nr]->ri_nsuffix, nsuffix );
- } else {
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: suffix \"%s\" in \"replica\" line is not valid for backend (ignored)\n",
- fname, lineno, cargv[i] + 7 );
- }
- } else {
+ switch ( add_replica_suffix( be, nr, cargv[i] + 7 ) ) {
+ case 1:
+ Debug( LDAP_DEBUG_ANY,
+ "%s: line %d: suffix \"%s\" in \"replica\" line is not valid for backend (ignored)\n",
+ fname, lineno, cargv[i] + 7 );
+ break;
+
+ case 2:
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unable to normalize suffix in \"replica\" line (ignored)\n",
fname, lineno, 0 );
+ break;
}
- free( nsuffix );
}
}
}
* repl.c
*/
LDAP_SLAPD_F (int) add_replica_info LDAP_P(( Backend *be, const char *host ));
+LDAP_SLAPD_F (int) add_replica_suffix LDAP_P(( Backend *be, int nr, const char *suffix ));
LDAP_SLAPD_F (void) replog LDAP_P(( Backend *be, Operation *op, char *dn, void *change ));
/*
return( i );
}
+int
+add_replica_suffix(
+ Backend *be,
+ int nr,
+ const char *suffix
+)
+{
+ char *nsuffix = ch_strdup( suffix );
+ int rc = 0;
+
+ if ( dn_normalize( nsuffix ) != NULL ) {
+ if ( select_backend( nsuffix, 0 ) == be ) {
+ charray_add( &be->be_replica[nr]->ri_nsuffix, nsuffix );
+ } else {
+ rc = 1;
+ }
+ } else {
+ rc = 2;
+ }
+ free( nsuffix );
+
+ return( rc );
+}
+
void
replog(
Backend *be,
int add_replica_info( Backend *be, const char *host )
{
- return(0);
+ return 0;
+}
+
+int add_replica_suffix( Backend *be, int nr, const char *suffix )
+{
+ return 0;
+}
+
+int parse_limits( Backend *be, const char *fname, int lineno, int argc, char **argv )
+{
+ return 0;
+}
+
+int parse_limit( const char *arg, struct slap_limits_set *limit )
+{
+ return 0;
+}
+
+int get_limits( Backend *be, const char *ndn, struct slap_limits_set **limit )
+{
+ return 0;
}