]> git.sur5r.net Git - openldap/commitdiff
Send error to active psearches upon overlay removal
authorRalf Haferkamp <ralf@openldap.org>
Wed, 23 Jun 2010 16:34:25 +0000 (16:34 +0000)
committerRalf Haferkamp <ralf@openldap.org>
Wed, 23 Jun 2010 16:34:25 +0000 (16:34 +0000)
servers/slapd/overlays/syncprov.c

index 4c2a0868a946ab2e396935268029e9b254e5b2b9..baf3806b3c4c4c9001661637c5fe568a6a933a12 100644 (file)
@@ -3015,6 +3015,9 @@ syncprov_db_close(
 {
     slap_overinst   *on = (slap_overinst *) be->bd_info;
     syncprov_info_t *si = (syncprov_info_t *)on->on_bi.bi_private;
+#ifdef SLAP_CONFIG_DELETE
+       syncops *so, *sonext;
+#endif /* SLAP_CONFIG_DELETE */
 
        if ( slapMode & SLAP_TOOL_MODE ) {
                return 0;
@@ -3035,6 +3038,19 @@ syncprov_db_close(
                syncprov_checkpoint( op, &rs, on );
        }
 
+#ifdef SLAP_CONFIG_DELETE
+       ldap_pvt_thread_mutex_lock( &si->si_ops_mutex );
+       for ( so=si->si_ops, sonext=so;  so; so=sonext  ) {
+               SlapReply rs = {REP_RESULT};
+               rs.sr_err = LDAP_UNAVAILABLE;
+               send_ldap_result( so->s_op, &rs );
+               sonext=so->s_next;
+               syncprov_drop_psearch( so, 0);
+       }
+       si->si_ops=NULL;
+       ldap_pvt_thread_mutex_unlock( &si->si_ops_mutex );
+#endif /* SLAP_CONFIG_DELETE */
+
     return 0;
 }