]> git.sur5r.net Git - openldap/commitdiff
make room for plugins that deal with quarantine end
authorPierangelo Masarati <ando@openldap.org>
Mon, 29 May 2006 21:43:20 +0000 (21:43 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 29 May 2006 21:43:20 +0000 (21:43 +0000)
servers/slapd/back-ldap/back-ldap.h
servers/slapd/back-ldap/bind.c
servers/slapd/back-meta/back-meta.h
servers/slapd/back-meta/conn.c

index f8e6bde9a0ddb2e3bd7ac73613f6f426a5969582..86a660e9115903f63fc8a39281beac3239ff4cb1 100644 (file)
@@ -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;
index 0072aa17eea53afcc44ddb4937dafc5156140d3a..a3f6e4adaed2d1a5287cd77969bce7a436ea340c 100644 (file)
@@ -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;
index 57778543ece3a1f029a22a345dbb2f2d074889bb..10ec708f96aaa65d845106ab90d527d83c7b9f3e 100644 (file)
@@ -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
index 3d8cc9c36d6786f298e54e9f5b750f6cabdb06b2..1fff70a773e93674ecad61e17321e5754f39e0c9 100644 (file)
@@ -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;