.B [credentials=<passwd>]
.B [realm=<realm>]
.B [secprops=<properties>]
+.B [timeout=<seconds>]
+.B [network\-timeout=<seconds>]
Specifies the bind credentials
.B lloadd
.B realm
option.
+The
+.B timeout
+parameter indicates how long an operation can be pending a response (result,
+search entry, ...) from the server in seconds. Due to how timeouts are
+detected, the timeout might not be detected and handled up to
+.B timeout
+seconds after it happens.
+
+The
+.B network\-timeout
+parameter sets how long the consumer will wait to establish a
+network connection to the provider. Once a connection is
+established, the
+.B timeout
+parameter determines how long the consumer will wait for the initial
+Bind request to complete.
+
+Timeout set to 0 means no timeout is in effect and by default, no timeouts are
+in effect.
+
.SH BACKEND OPTIONS
.TP
.B backend
.B uri=ldap[s]://<hostname>[:port]
.B [retry=<retry interval in ms>]
-.B [network\-timeout=<seconds>]
-.B [timeout=<seconds>]
.B [keepalive=<idle>:<probes>:<interval>]
.B [starttls=yes|critical]
.B [tls_cert=<file>]
.BR 0 ,
the default, means no limit will be imposed for this backend.
-The
-.B network\-timeout
-parameter sets how long the consumer will wait to establish a
-network connection to the provider. Once a connection is
-established, the
-.B timeout
-parameter determines how long the consumer will wait for the initial
-Bind request to complete. By default no timeouts are in effect.
-
The
.B keepalive
parameter sets the values of \fIidle\fP, \fIprobes\fP, and \fIinterval\fP
goto fail;
}
- event_add( conn->event, lload_write_timeout );
+ event_add( conn->event, lload_timeout_net );
LDAP_LIST_INSERT_HEAD( &b->b_connecting, conn, next );
Debug( LDAP_DEBUG_CONNS, "upstream_name_cb: "
"connection to backend uri=%s in progress\n",
goto fail;
}
- event_add( conn->event, lload_write_timeout );
+ event_add( conn->event, lload_timeout_net );
LDAP_LIST_INSERT_HEAD( &b->b_connecting, conn, next );
Debug( LDAP_DEBUG_CONNS, "backend_connect: "
"connection to backend uri=%s in progress\n",
event_del( c->c_read_event );
event_del( c->c_write_event );
+ c->c_read_timeout = NULL;
event_assign( c->c_read_event, base, c->c_fd, EV_READ|EV_PERSIST,
connection_read_cb, c );
- event_add( c->c_read_event, NULL );
+ event_add( c->c_read_event, c->c_read_timeout );
event_assign( c->c_write_event, base, c->c_fd, EV_WRITE,
connection_write_cb, c );
if ( rc ) {
c->c_refcnt++;
+ c->c_read_timeout = lload_timeout_net;
read_cb = write_cb = client_tls_handshake_cb;
}
}
goto fail;
}
c->c_read_event = event;
- event_add( c->c_read_event, NULL );
+ event_add( c->c_read_event, c->c_read_timeout );
event = event_new( base, s, EV_WRITE, write_cb, c );
if ( !event ) {
static FILE *logfile;
static char *logfileName;
-static struct timeval timeout_write_tv = { 10, 0 };
+static struct timeval timeout_net_tv, timeout_write_tv = { 10, 0 };
lload_features_t lload_features;
int slap_conn_max_pdus_per_cycle = LLOAD_CONN_MAX_PDUS_PER_CYCLE_DEFAULT;
+struct timeval *lload_timeout_net = NULL;
struct timeval *lload_write_timeout = &timeout_write_tv;
char *slapd_pid_file = NULL;
*ptr = '\0';
}
+ if ( bindconf.sb_timeout_net ) {
+ timeout_net_tv.tv_sec = bindconf.sb_timeout_net;
+ lload_timeout_net = &timeout_net_tv;
+ } else {
+ lload_timeout_net = NULL;
+ }
+
#ifdef HAVE_TLS
if ( bindconf.sb_tls_do_init ) {
bindconf_tls_set( &bindconf, slap_tls_backend_ld );
}
}
- event_add( c->c_read_event, NULL );
+ event_add( c->c_read_event, c->c_read_timeout );
Debug( LDAP_DEBUG_CONNS, "handle_pdus: "
"re-enabled read event on connid=%lu\n",
c->c_connid );
CONNECTION_DESTROY(c);
return;
}
- event_add( c->c_read_event, NULL );
+ event_add( c->c_read_event, c->c_read_timeout );
Debug( LDAP_DEBUG_CONNS, "connection_read_cb: "
"re-enabled read event on connid=%lu\n",
c->c_connid );
ldap_pvt_thread_mutex_unlock( &c->c_io_mutex );
CONNECTION_LOCK_DECREF(c);
+ c->c_read_timeout = lload_timeout_net;
event_assign( c->c_read_event, base, c->c_fd, EV_READ|EV_PERSIST,
client_tls_handshake_cb, c );
- event_add( c->c_read_event, NULL );
+ event_add( c->c_read_event, c->c_read_timeout );
event_assign( c->c_write_event, base, c->c_fd, EV_WRITE,
client_tls_handshake_cb, c );
LDAP_SLAPD_V (int) global_gentlehup;
LDAP_SLAPD_V (int) global_idletimeout;
+LDAP_SLAPD_V (struct timeval *) lload_timeout_net;
LDAP_SLAPD_V (struct timeval *) lload_write_timeout;
LDAP_SLAPD_V (char *) global_host;
/* must not be used while holding either mutex */
struct event *c_read_event, *c_write_event;
+ struct timeval *c_read_timeout;
/* can only be changed by binding thread */
struct berval c_sasl_bind_mech; /* mech in progress */
c->c_pdu_cb = handle_one_response;
c->c_state = LLOAD_C_READY;
c->c_type = LLOAD_C_OPEN;
+ c->c_read_timeout = NULL;
+ event_add( c->c_read_event, c->c_read_timeout );
+ Debug( LDAP_DEBUG_CONNS, "upstream_bind_cb: "
+ "connid=%lu finished binding, now active\n",
+ c->c_connid );
CONNECTION_UNLOCK_INCREF(c);
ldap_pvt_thread_mutex_lock( &b->b_mutex );
LDAP_CIRCLEQ_REMOVE( &b->b_preparing, c, c_next );
connection_write_cb( -1, 0, c );
CONNECTION_LOCK_DECREF(c);
+ c->c_read_timeout = lload_timeout_net;
+ event_add( c->c_read_event, c->c_read_timeout );
CONNECTION_UNLOCK_OR_DESTROY(c);
return NULL;
event_del( c->c_read_event );
event_del( c->c_write_event );
+ c->c_read_timeout = NULL;
event_assign( c->c_read_event, base, c->c_fd, EV_READ|EV_PERSIST,
connection_read_cb, c );
- event_add( c->c_read_event, NULL );
+ event_add( c->c_read_event, c->c_read_timeout );
event_assign( c->c_write_event, base, c->c_fd, EV_WRITE,
connection_write_cb, c );
event_del( c->c_read_event );
event_del( c->c_write_event );
+ c->c_read_timeout = lload_timeout_net;
event_assign( c->c_read_event, base, c->c_fd, EV_READ|EV_PERSIST,
upstream_tls_handshake_cb, c );
event_assign( c->c_write_event, base, c->c_fd, EV_WRITE,
upstream_tls_handshake_cb, c );
- event_add( c->c_read_event, NULL );
+ event_add( c->c_read_event, c->c_read_timeout );
event_add( c->c_write_event, lload_write_timeout );
CONNECTION_UNLOCK(c);
connection_write_cb( s, 0, c );
CONNECTION_LOCK_DECREF(c);
}
- event_add( c->c_read_event, NULL );
+ event_add( c->c_read_event, c->c_read_timeout );
c->c_destroy = upstream_destroy;
CONNECTION_UNLOCK_OR_DESTROY(c);