/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * 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
{
if ( rs->sr_rspoid != NULL ) {
rc = ber_printf( ber, "ts",
- LDAP_TAG_EXOP_RES_OID, rs->sr_rspoid );
+ rs->sr_type == REP_EXTENDED
+ ? LDAP_TAG_EXOP_RES_OID : LDAP_TAG_IM_RES_OID,
+ rs->sr_rspoid );
}
if( rc != -1 && rs->sr_rspdata != NULL ) {
rc = ber_printf( ber, "tO",
- LDAP_TAG_EXOP_RES_VALUE, rs->sr_rspdata );
+ rs->sr_type == REP_EXTENDED
+ ? LDAP_TAG_EXOP_RES_VALUE : LDAP_TAG_IM_RES_VALUE,
+ rs->sr_rspdata );
}
}
}
#endif /* LDAP_SLAPI */
- ldap_pvt_thread_mutex_lock( &SLAPD_GLOBAL(counters).sc_sent_mutex );
- ldap_pvt_mp_add_ulong( SLAPD_GLOBAL(counters).sc_pdu, 1 );
- ldap_pvt_mp_add_ulong( SLAPD_GLOBAL(counters).sc_bytes, bytes );
- ldap_pvt_thread_mutex_unlock( &SLAPD_GLOBAL(counters).sc_sent_mutex );
+ ldap_pvt_thread_mutex_lock( &slap_counters.sc_sent_mutex );
+ ldap_pvt_mp_add_ulong( slap_counters.sc_pdu, 1 );
+ ldap_pvt_mp_add_ulong( slap_counters.sc_bytes, bytes );
+ ldap_pvt_thread_mutex_unlock( &slap_counters.sc_sent_mutex );
cleanup:;
/* Tell caller that we did this for real, as opposed to being
}
rs->sr_nentries++;
- ldap_pvt_thread_mutex_lock( &SLAPD_GLOBAL(counters).sc_sent_mutex );
- ldap_pvt_mp_add_ulong( SLAPD_GLOBAL(counters).sc_bytes, bytes );
- ldap_pvt_mp_add_ulong( SLAPD_GLOBAL(counters).sc_entries, 1 );
- ldap_pvt_mp_add_ulong( SLAPD_GLOBAL(counters).sc_pdu, 1 );
- ldap_pvt_thread_mutex_unlock( &SLAPD_GLOBAL(counters).sc_sent_mutex );
+ ldap_pvt_thread_mutex_lock( &slap_counters.sc_sent_mutex );
+ ldap_pvt_mp_add_ulong( slap_counters.sc_bytes, bytes );
+ ldap_pvt_mp_add_ulong( slap_counters.sc_entries, 1 );
+ ldap_pvt_mp_add_ulong( slap_counters.sc_pdu, 1 );
+ ldap_pvt_thread_mutex_unlock( &slap_counters.sc_sent_mutex );
}
Statslog( LDAP_DEBUG_STATS2, "%s ENTRY dn=\"%s\"\n",
bytes = send_ldap_ber( op->o_conn, ber );
ber_free_buf( ber );
- ldap_pvt_thread_mutex_lock( &SLAPD_GLOBAL(counters).sc_sent_mutex );
- ldap_pvt_mp_add_ulong( SLAPD_GLOBAL(counters).sc_bytes, bytes );
- ldap_pvt_mp_add_ulong( SLAPD_GLOBAL(counters).sc_refs, 1 );
- ldap_pvt_mp_add_ulong( SLAPD_GLOBAL(counters).sc_pdu, 1 );
- ldap_pvt_thread_mutex_unlock( &SLAPD_GLOBAL(counters).sc_sent_mutex );
+ ldap_pvt_thread_mutex_lock( &slap_counters.sc_sent_mutex );
+ ldap_pvt_mp_add_ulong( slap_counters.sc_bytes, bytes );
+ ldap_pvt_mp_add_ulong( slap_counters.sc_refs, 1 );
+ ldap_pvt_mp_add_ulong( slap_counters.sc_pdu, 1 );
+ ldap_pvt_thread_mutex_unlock( &slap_counters.sc_sent_mutex );
#ifdef LDAP_CONNECTIONLESS
}
#endif
*ctrl = (LDAPControl *) slap_sl_calloc( 1, sizeof(LDAPControl), NULL );
} else {
/* retry: free previous try */
- slap_sl_free( (*ctrl)->ldctl_value.bv_val, &op->o_tmpmemctx );
+ slap_sl_free( (*ctrl)->ldctl_value.bv_val, op->o_tmpmemctx );
}
**ctrl = c;