Commit 79f7e79f authored by Ondřej Kuzník's avatar Ondřej Kuzník Committed by Ondřej Kuzník
Browse files

Set up connections in the worker threads

parent bf66b48f
......@@ -99,9 +99,10 @@ backend_select( Operation *op )
}
void *
backend_connect( Backend *b )
backend_connect( void *ctx, void *arg )
{
struct evutil_addrinfo hints = {};
Backend *b = arg;
#ifdef LDAP_PF_LOCAL
if ( b->b_proto == LDAP_PROTO_IPC ) {
......
......@@ -1300,10 +1300,7 @@ slapd_daemon( struct event_base *daemon_base )
}
LDAP_STAILQ_FOREACH ( b, &backend, b_next ) {
rc = backend_connect( b );
if ( rc ) {
return rc;
}
ldap_pvt_thread_pool_submit( &connection_pool, backend_connect, b );
}
lloadd_inited = 1;
......
......@@ -40,7 +40,7 @@ struct config_reply_s; /* config.h */
* backend.c
*/
LDAP_SLAPD_F (int) backend_connect( Backend *b );
LDAP_SLAPD_F (void *) backend_connect( void *ctx, void *arg );
/*
* ch_malloc.c
......
......@@ -102,6 +102,8 @@ upstream_destroy( Connection *c )
b->b_conns = NULL;
ldap_pvt_thread_mutex_unlock( &b->b_lock );
ldap_pvt_thread_pool_submit( &connection_pool, backend_connect, b );
ldap_pvt_thread_mutex_lock( &c->c_mutex );
event_del( c->c_read_event );
......
Supports Markdown
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