LloadBackend *b = arg;
if ( b == NULL || c->c_private == b ) {
- if ( start == upstream_bind ) {
- /* FIXME: is upstream_bind safe without a reference of its own? */
- CONNECTION_LOCK(c);
- } else {
- CONNECTION_LOCK_DECREF(c);
- }
- CONNECTION_DESTROY(c);
+ CONNECTION_LOCK_DESTROY(c);
return 1;
}
return 0;
BerElement *ber;
ber_int_t msgid;
- CONNECTION_LOCK(c);
+ CONNECTION_LOCK_DECREF(c);
c->c_pdu_cb = upstream_bind_cb;
CONNECTION_UNLOCK_INCREF(c);
b->b_last_conn = c;
} else {
rc = 1;
+ c->c_refcnt++;
ldap_pvt_thread_pool_submit( &connection_pool, upstream_bind, c );
}