mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
Configuration part for retry timeouts
This commit is contained in:
parent
673513a017
commit
dc5e2538ec
@ -508,6 +508,15 @@ config_backend( ConfigArgs *c )
|
||||
goto done;
|
||||
}
|
||||
|
||||
if ( b->b_retry_timeout < 0 ) {
|
||||
Debug( LDAP_DEBUG_ANY, "config_backend: "
|
||||
"invalid retry timeout configuration\n" );
|
||||
rc = -1;
|
||||
goto done;
|
||||
}
|
||||
b->b_retry_tv.tv_sec = b->b_retry_timeout / 1000;
|
||||
b->b_retry_tv.tv_usec = ( b->b_retry_timeout % 1000 ) * 1000;
|
||||
|
||||
if ( BER_BVISNULL( &b->b_bindconf.sb_uri ) ) {
|
||||
Debug( LDAP_DEBUG_ANY, "config_backend: "
|
||||
"backend address not specified\n" );
|
||||
@ -1907,6 +1916,7 @@ static slap_cf_aux_table bindkey[] = {
|
||||
|
||||
{ BER_BVC("numconns="), offsetof(Backend, b_numconns), 'i', 0, NULL },
|
||||
{ BER_BVC("bindconns="), offsetof(Backend, b_numbindconns), 'i', 0, NULL },
|
||||
{ BER_BVC("retry="), offsetof(Backend, b_retry_timeout), 'i', 0, NULL },
|
||||
#ifdef HAVE_TLS
|
||||
{ BER_BVC("starttls="), offsetof(Backend, b_bindconf.sb_tls), 'i', 0, tlskey },
|
||||
{ BER_BVC("tls_cert="), offsetof(Backend, b_bindconf.sb_tls_cert), 's', 1, NULL },
|
||||
|
@ -247,6 +247,10 @@ struct Backend {
|
||||
enum lload_tls_type b_tls;
|
||||
char *b_host;
|
||||
|
||||
int b_retry_timeout, b_failed;
|
||||
struct event *b_retry_event;
|
||||
struct timeval b_retry_tv;
|
||||
|
||||
int b_numconns, b_numbindconns;
|
||||
int b_bindavail, b_active, b_opening;
|
||||
LDAP_LIST_HEAD(ConnSt, Connection) b_conns, b_bindconns;
|
||||
|
@ -813,7 +813,8 @@ upstream_destroy( Connection *c )
|
||||
{
|
||||
Backend *b = c->c_private;
|
||||
|
||||
Debug( LDAP_DEBUG_CONNS, "upstream_destroy: freeing connection %lu\n",
|
||||
Debug( LDAP_DEBUG_CONNS, "upstream_destroy: "
|
||||
"freeing connection %lu\n",
|
||||
c->c_connid );
|
||||
|
||||
assert( c->c_state != SLAP_C_INVALID );
|
||||
|
Loading…
Reference in New Issue
Block a user