mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-30 13:30:57 +08:00
Set up connections in the worker threads
This commit is contained in:
parent
bf66b48fe3
commit
79f7e79f15
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user