From: Pierangelo Masarati Date: Mon, 29 May 2006 21:43:20 +0000 (+0000) Subject: make room for plugins that deal with quarantine end X-Git-Tag: OPENLDAP_REL_ENG_2_4_3ALPHA~9^2~199 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a6406de871c08239a4dbbd513bde3f58acb19742;p=openldap make room for plugins that deal with quarantine end --- diff --git a/servers/slapd/back-ldap/back-ldap.h b/servers/slapd/back-ldap/back-ldap.h index f8e6bde9a0..86a660e911 100644 --- a/servers/slapd/back-ldap/back-ldap.h +++ b/servers/slapd/back-ldap/back-ldap.h @@ -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; diff --git a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c index 0072aa17ee..a3f6e4adae 100644 --- a/servers/slapd/back-ldap/bind.c +++ b/servers/slapd/back-ldap/bind.c @@ -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; diff --git a/servers/slapd/back-meta/back-meta.h b/servers/slapd/back-meta/back-meta.h index 57778543ec..10ec708f96 100644 --- a/servers/slapd/back-meta/back-meta.h +++ b/servers/slapd/back-meta/back-meta.h @@ -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 diff --git a/servers/slapd/back-meta/conn.c b/servers/slapd/back-meta/conn.c index 3d8cc9c36d..1fff70a773 100644 --- a/servers/slapd/back-meta/conn.c +++ b/servers/slapd/back-meta/conn.c @@ -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;