}
static long send_ldap_ber(
- Connection *conn,
+ Operation *op,
BerElement *ber )
{
+ Connection *conn = op->o_conn;
ber_len_t bytes;
long ret = 0;
int closing = 0;
/* write only one pdu at a time - wait til it's our turn */
ldap_pvt_thread_mutex_lock( &conn->c_write1_mutex );
- if ( connection_state_closing( conn )) {
+ if ( op->o_abandon || connection_state_closing( conn )) {
ldap_pvt_thread_mutex_unlock( &conn->c_write1_mutex );
return 0;
}
}
/* send BER */
- bytes = send_ldap_ber( op->o_conn, ber );
+ bytes = send_ldap_ber( op, ber );
#ifdef LDAP_CONNECTIONLESS
if (!op->o_conn || op->o_conn->c_is_udp == 0)
#endif
}
if ( op->o_res_ber == NULL ) {
- bytes = send_ldap_ber( op->o_conn, ber );
+ bytes = send_ldap_ber( op, ber );
ber_free_buf( ber );
if ( bytes < 0 ) {
#ifdef LDAP_CONNECTIONLESS
if (!op->o_conn || op->o_conn->c_is_udp == 0) {
#endif
- bytes = send_ldap_ber( op->o_conn, ber );
+ bytes = send_ldap_ber( op, ber );
ber_free_buf( ber );
if ( bytes < 0 ) {