/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2014 The OpenLDAP Foundation.
+ * Copyright 1998-2017 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
sd = c->c_sd;
c->c_sd = AC_SOCKET_INVALID;
- c->c_conn_state = SLAP_C_INVALID;
- c->c_struct_state = SLAP_C_UNUSED;
c->c_close_reason = "?"; /* should never be needed */
sb = c->c_sb;
ber_len_t max = sockbuf_max_incoming;
ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_SET_MAX_INCOMING, &max );
}
+ c->c_conn_state = SLAP_C_INVALID;
+ c->c_struct_state = SLAP_C_UNUSED;
/* c must be fully reset by this point; when we call slapd_remove
* it may get immediately reused by a new connection.
SlapReply rs = {REP_RESULT};
next = LDAP_STAILQ_NEXT( o, o_next );
+ /* don't abandon an op twice */
+ if ( o->o_abandon )
+ continue;
op.orn_msgid = o->o_msgid;
o->o_abandon = 1;
op.o_bd = frontendDB;
ber_set_option( op->o_ber, LBER_OPT_BER_MEMCTX, &memctx_null );
- LDAP_STAILQ_REMOVE( &conn->c_ops, op, Operation, o_next);
- LDAP_STAILQ_NEXT(op, o_next) = NULL;
+#ifdef LDAP_X_TXN
+ if ( rc != LDAP_X_TXN_SPECIFY_OKAY )
+#endif
+ {
+ LDAP_STAILQ_REMOVE( &conn->c_ops, op, Operation, o_next);
+ LDAP_STAILQ_NEXT(op, o_next) = NULL;
+ }
conn->c_n_ops_executing--;
conn->c_n_ops_completed++;
connection_resched( conn );
ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
- slap_op_free( op, ctx );
+#ifdef LDAP_X_TXN
+ if ( rc != LDAP_X_TXN_SPECIFY_OKAY )
+#endif
+ {
+ slap_op_free( op, ctx );
+ }
return NULL;
}
assert( c->c_conn_state == SLAP_C_CLIENT );
c->c_listener = NULL;
- c->c_conn_state = SLAP_C_INVALID;
- c->c_struct_state = SLAP_C_UNUSED;
c->c_sd = AC_SOCKET_INVALID;
c->c_close_reason = "?"; /* should never be needed */
sb = c->c_sb;
ber_len_t max = sockbuf_max_incoming;
ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_SET_MAX_INCOMING, &max );
}
+ c->c_conn_state = SLAP_C_INVALID;
+ c->c_struct_state = SLAP_C_UNUSED;
slapd_remove( s, sb, 0, 1, 0 );
connection_return( c );