/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2012 The OpenLDAP Foundation.
+ * Copyright 1998-2013 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
{ BER_BVNULL, 0 }
};
-static int
+int
slap_keepalive_parse(
struct berval *val,
void *bc,
}
#endif
+/*
+ * set connection keepalive options
+ */
+void
+slap_client_keepalive(LDAP *ld, slap_keepalive *sk)
+{
+ if (!sk) return;
+
+ if ( sk->sk_idle ) {
+ ldap_set_option( ld, LDAP_OPT_X_KEEPALIVE_IDLE, &sk->sk_idle );
+ }
+
+ if ( sk->sk_probes ) {
+ ldap_set_option( ld, LDAP_OPT_X_KEEPALIVE_PROBES, &sk->sk_probes );
+ }
+
+ if ( sk->sk_interval ) {
+ ldap_set_option( ld, LDAP_OPT_X_KEEPALIVE_INTERVAL, &sk->sk_interval );
+ }
+
+ return;
+}
+
/*
* connect to a client using the bindconf data
* note: should move "version" into bindconf...
ldap_set_option( ld, LDAP_OPT_NETWORK_TIMEOUT, &tv );
}
+ /* setting network keepalive options */
+ slap_client_keepalive(ld, &sb->sb_keepalive);
+
+#if 0
if ( sb->sb_keepalive.sk_idle ) {
ldap_set_option( ld, LDAP_OPT_X_KEEPALIVE_IDLE, &sb->sb_keepalive.sk_idle );
}
if ( sb->sb_keepalive.sk_interval ) {
ldap_set_option( ld, LDAP_OPT_X_KEEPALIVE_INTERVAL, &sb->sb_keepalive.sk_interval );
}
+#endif /* 0 */
#ifdef HAVE_TLS
if ( sb->sb_tls_do_init ) {