X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Frepl.c;h=529416023c97fc1cd7afa356f144c50c9a4c807a;hb=af866c3b44ba37577671f2bffd482499f4b8bc00;hp=5d60fc51cb8c30407d209acd5c798428da4603f6;hpb=3c598e89fb34a892d369a138daa8c3314294493c;p=openldap diff --git a/servers/slapd/repl.c b/servers/slapd/repl.c index 5d60fc51cb..529416023c 100644 --- a/servers/slapd/repl.c +++ b/servers/slapd/repl.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2004 The OpenLDAP Foundation. + * Copyright 1998-2005 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ int add_replica_info( Backend *be, + const char *uri, const char *host ) { @@ -59,7 +60,8 @@ add_replica_info( be->be_replica[ i ] = ch_calloc( sizeof( struct slap_replica_info ), 1 ); - be->be_replica[ i ]->ri_host = ch_strdup( host ); + be->be_replica[ i ]->ri_uri = uri; + be->be_replica[ i ]->ri_host = host; be->be_replica[ i ]->ri_nsuffix = NULL; be->be_replica[ i ]->ri_attrs = NULL; be->be_replica[ i + 1 ] = NULL; @@ -134,14 +136,16 @@ replog( Operation *op ) #endif int subsets = 0; long now = slap_get_time(); + char *replogfile; - if ( op->o_bd->be_replogfile == NULL && replogfile == NULL ) { + replogfile = op->o_bd->be_replogfile ? op->o_bd->be_replogfile : + frontendDB->be_replogfile; + if ( !replogfile ) { return; } ldap_pvt_thread_mutex_lock( &replog_mutex ); - if ( (fp = lock_fopen( op->o_bd->be_replogfile ? op->o_bd->be_replogfile : - replogfile, "a", &lfp )) == NULL ) { + if ( (fp = lock_fopen( replogfile, "a", &lfp )) == NULL ) { ldap_pvt_thread_mutex_unlock( &replog_mutex ); return; } @@ -300,19 +304,20 @@ replog1( * in any subset, otherwise drop it. */ if ( ocs && ml->sml_desc == slap_schema.si_ad_objectClass - && ml->sml_bvalues ) { + && ml->sml_values ) + { int i, first = 1; if ( ocs == -1 ) ocs = 0; - for ( i=0; ml->sml_bvalues[i].bv_val; i++ ) { + for ( i=0; ml->sml_values[i].bv_val; i++ ) { int match = 0; for ( an = ri->ri_attrs; an->an_name.bv_val; an++ ) { if ( an->an_oc ) { ocs = 1; match |= an->an_oc_exclude; - if ( ml->sml_bvalues[i].bv_len == an->an_name.bv_len - && !strcasecmp(ml->sml_bvalues[i].bv_val, + if ( ml->sml_values[i].bv_len == an->an_name.bv_len + && !strcasecmp(ml->sml_values[i].bv_val, an->an_name.bv_val ) ) { match = !an->an_oc_exclude; break; @@ -357,8 +362,8 @@ replog1( dohdr = 0; } fprintf( fp, "%s: %s\n", did, type ); - if ( ml->sml_bvalues ) { - print_vals( fp, &ml->sml_desc->ad_cname, ml->sml_bvalues ); + if ( ml->sml_values ) { + print_vals( fp, &ml->sml_desc->ad_cname, ml->sml_values ); } fprintf( fp, "-\n" ); }