Commit b039e7c1 authored by Ondřej Kuzník's avatar Ondřej Kuzník
Browse files

Keep a reference around for the bind task

parent 0314f95d
......@@ -1432,13 +1432,7 @@ backend_conn_cb( ldap_pvt_thread_start_t *start, void *startarg, void *arg )
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;
......
......@@ -361,7 +361,7 @@ upstream_bind( void *ctx, void *arg )
BerElement *ber;
ber_int_t msgid;
CONNECTION_LOCK(c);
CONNECTION_LOCK_DECREF(c);
c->c_pdu_cb = upstream_bind_cb;
CONNECTION_UNLOCK_INCREF(c);
......@@ -460,6 +460,7 @@ upstream_finish( LloadConnection *c )
b->b_last_conn = c;
} else {
rc = 1;
c->c_refcnt++;
ldap_pvt_thread_pool_submit( &connection_pool, upstream_bind, c );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment