]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/backglue.c
cleanup bind
[openldap] / servers / slapd / backglue.c
index 69c102d231c8a2776d59fe7eb925bfa44b26a631..4db1e9f40a476d249dc763bef6c7d3e569952e3d 100644 (file)
@@ -405,7 +405,23 @@ glue_back_search (
                                        s2limit, t2limit, filter, filterstr,
                                        attrs, attrsonly);
                        }
+
+                       switch ( gs.err ) {
+
+                       /*
+                        * Add errors that should result in dropping
+                        * the search
+                        */
+                       case LDAP_SIZELIMIT_EXCEEDED:
+                       case LDAP_TIMELIMIT_EXCEEDED:
+                       case LDAP_ADMINLIMIT_EXCEEDED:
+                               goto end_of_loop;
+                       
+                       default:
+                               break;
+                       }
                }
+end_of_loop:;
                break;
        }
        op->o_callback = gs.prevcb;
@@ -594,7 +610,7 @@ glue_sub_init( )
         * backends and connect them to their superior.
         */
        for (i = nBackendDB - 1, b1=&backendDB[i]; cont && i>=0; b1--,i--) {
-               if (b1->be_flags & SLAP_BFLAG_GLUE_SUBORDINATE) {
+               if (SLAP_GLUE_SUBORDINATE ( b1 ) ) {
                        /* The last database cannot be a subordinate of noone */
                        if (i == nBackendDB - 1) {
                                b1->be_flags ^= SLAP_BFLAG_GLUE_SUBORDINATE;
@@ -603,11 +619,11 @@ glue_sub_init( )
                }
                gi = NULL;
                for (j = i-1, be=&backendDB[j]; j>=0; be--,j--) {
-                       if (!(be->be_flags & SLAP_BFLAG_GLUE_SUBORDINATE)) {
+                       if ( ! SLAP_GLUE_SUBORDINATE( be ) ) {
                                continue;
                        }
                        /* We will only link it once */
-                       if (be->be_flags & SLAP_BFLAG_GLUE_LINKED) {
+                       if ( SLAP_GLUE_LINKED( be ) ) {
                                continue;
                        }
                        if (!dnIsSuffix(&be->be_nsuffix[0], &b1->be_nsuffix[0])) {