- change in message to modlist conversion

This commit is contained in:
Jong Hyuk Choi 2003-05-20 01:45:12 +00:00
parent 074f54f300
commit 4f58efc4d1
4 changed files with 21 additions and 6 deletions

View file

@ -476,6 +476,10 @@ ber_flatten2 LDAP_P((
struct berval *bv, struct berval *bv,
int alloc )); int alloc ));
LBER_F( int )
ber_remaining LDAP_P((
BerElement *ber ));
/* /*
* LBER ber accessor functions * LBER ber accessor functions
*/ */

View file

@ -717,3 +717,9 @@ ber_rewind ( BerElement * ber )
ber->ber_end = ber->ber_ptr; ber->ber_end = ber->ber_ptr;
ber->ber_ptr = ber->ber_buf; ber->ber_ptr = ber->ber_buf;
} }
int
ber_remaining( BerElement * ber )
{
return ber_pvt_ber_remaining( ber );
}

View file

@ -500,7 +500,7 @@ do_syncrepl(
entry_free( entry ); entry_free( entry );
for ( ml = modlist; ml != NULL; ml = mlnext ) { for ( ml = modlist; ml != NULL; ml = mlnext ) {
mlnext = ml->sml_next; mlnext = ml->sml_next;
free( ml ); ber_memfree( ml );
} }
break; break;
@ -699,6 +699,8 @@ syncrepl_message_to_entry(
LDAPControl** rctrls = NULL; LDAPControl** rctrls = NULL;
BerElement* ctrl_ber; BerElement* ctrl_ber;
ber_tag_t tag;
*modlist = NULL; *modlist = NULL;
if ( ldap_msgtype( msg ) != LDAP_RES_SEARCH_ENTRY ) { if ( ldap_msgtype( msg ) != LDAP_RES_SEARCH_ENTRY ) {
@ -732,10 +734,10 @@ syncrepl_message_to_entry(
e->e_attrs = NULL; e->e_attrs = NULL;
for ( rc = ldap_get_attribute_ber( ld, msg, ber, &tmp.sml_type, &tmp.sml_bvalues); while ( ber_remaining( ber ) ) {
rc == LDAP_SUCCESS; tag = ber_scanf( ber, "{mW}", &tmp.sml_type, &tmp.sml_values );
rc = ldap_get_attribute_ber( ld, msg, ber, &tmp.sml_type, &tmp.sml_bvalues))
{ if ( tag == LBER_ERROR ) break;
if ( tmp.sml_type.bv_val == NULL ) break; if ( tmp.sml_type.bv_val == NULL ) break;
mod = (Modifications *) ch_malloc( sizeof( Modifications )); mod = (Modifications *) ch_malloc( sizeof( Modifications ));
@ -862,7 +864,7 @@ done:
return e; return e;
} }
int int
syncuuid_cmp( const void* v_uuid1, const void* v_uuid2 ) syncuuid_cmp( const void* v_uuid1, const void* v_uuid2 )
{ {
const struct berval *uuid1 = v_uuid1; const struct berval *uuid1 = v_uuid1;

View file

@ -39,6 +39,9 @@ if test $WAIT != 0 ; then
read foo read foo
fi fi
echo "Waiting 5 seconds to wait for master to start..."
sleep 5
echo "Starting slave slapd on TCP/IP port $SLAVEPORT..." echo "Starting slave slapd on TCP/IP port $SLAVEPORT..."
. $CONFFILTER $BACKEND $MONITORDB < $SRSLAVECONF > $REPLCONF . $CONFFILTER $BACKEND $MONITORDB < $SRSLAVECONF > $REPLCONF
$SLAPD -f $REPLCONF -h $SLAVEURI -d $LVL $TIMING > $SLAVELOG 2>&1 & $SLAPD -f $REPLCONF -h $SLAVEURI -d $LVL $TIMING > $SLAVELOG 2>&1 &