mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-31 20:19:34 -05:00
make room for plugins that deal with quarantine end
This commit is contained in:
parent
d8442daba6
commit
a6406de871
4 changed files with 26 additions and 0 deletions
|
|
@ -26,6 +26,8 @@
|
|||
|
||||
LDAP_BEGIN_DECL
|
||||
|
||||
struct ldapinfo_t;
|
||||
|
||||
typedef struct ldapconn_t {
|
||||
Connection *lc_conn;
|
||||
#define LDAP_BACK_PCONN ((void *)0x0)
|
||||
|
|
@ -135,6 +137,11 @@ typedef struct slap_retry_info_t {
|
|||
#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 */
|
||||
|
|
@ -252,6 +259,8 @@ typedef struct ldapinfo_t {
|
|||
#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;
|
||||
|
|
|
|||
|
|
@ -885,6 +885,11 @@ ldap_back_quarantine(
|
|||
"%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;
|
||||
|
|
|
|||
|
|
@ -263,6 +263,11 @@ typedef struct metacandidates_t {
|
|||
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;
|
||||
|
|
@ -283,6 +288,8 @@ typedef struct metainfo_t {
|
|||
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
|
||||
|
|
|
|||
|
|
@ -1429,6 +1429,11 @@ meta_back_quarantine(
|
|||
"%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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue