LDAP_BEGIN_DECL
+struct ldapinfo_t;
+
typedef struct ldapconn_t {
Connection *lc_conn;
#define LDAP_BACK_PCONN ((void *)0x0)
#define SLAP_RETRYNUM_FINITE(n) ((n) > SLAP_RETRYNUM_FOREVER) /* not forever */
} slap_retry_info_t;
+/*
+ * Hook to allow mucking with ldapinfo_t when quarantine is over
+ */
+typedef int (*ldap_back_quarantine_f)(struct ldapinfo_t *, void *);
+
typedef struct ldapinfo_t {
/* li_uri: the string that goes into ldap_initialize()
* TODO: use li_acl.sb_uri instead */
#define LDAP_BACK_FQ_RETRYING (2)
#define LDAP_BACK_QUARANTINE(li) ( (li)->li_quarantine.ri_num != NULL )
+ ldap_back_quarantine_f li_quarantine_func;
+ void *li_quarantine_arg;
time_t li_network_timeout;
time_t li_conn_ttl;
"%s: ldap_back_quarantine exit.\n",
op->o_log_prefix, ri->ri_idx, ri->ri_count );
+ if ( li->li_quarantine_func ) {
+ (void)li->li_quarantine_func( li,
+ li->li_quarantine_arg );
+ }
+
ri->ri_count = 0;
ri->ri_idx = 0;
li->li_isquarantined = LDAP_BACK_FQ_NO;
SlapReply *mc_candidates;
} metacandidates_t;
+/*
+ * Hook to allow mucking with metainfo_t/metatarget_t when quarantine is over
+ */
+typedef int (*meta_back_quarantine_f)(struct metainfo_t *, int target, void *);
+
typedef struct metainfo_t {
int mi_ntargets;
int mi_defaulttarget;
slap_retry_info_t mi_quarantine;
#define META_BACK_QUARANTINE(mi) ( (mi)->mi_quarantine.ri_num != NULL )
+ meta_back_quarantine_f mi_quarantine_func;
+ meta_back_quarantine_f mi_quarantine_arg;
unsigned mi_flags;
#define li_flags mi_flags
"%s: meta_back_quarantine exit.\n",
op->o_log_prefix, ri->ri_idx, ri->ri_count );
+ if ( mi->mi_quarantine_func ) {
+ (void)mi->mi_quarantine_func( mi, candidate,
+ mi->mi_quarantine_arg );
+ }
+
ri->ri_count = 0;
ri->ri_idx = 0;
mt->mt_isquarantined = LDAP_BACK_FQ_NO;