]> git.sur5r.net Git - openldap/commitdiff
address ITS#4332; might remove dynamicObject counting
authorPierangelo Masarati <ando@openldap.org>
Sat, 14 Jan 2006 11:12:56 +0000 (11:12 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 14 Jan 2006 11:12:56 +0000 (11:12 +0000)
servers/slapd/overlays/dds.c

index 30a606d6f5795f14f6a3329648acd2277438622e..8cf4e57d7d600d0b7e90dbaa909b1cd6e2900b2f 100644 (file)
@@ -1723,17 +1723,17 @@ dds_db_open(
        di->di_suffix = be->be_suffix;
        di->di_nsuffix = be->be_nsuffix;
 
-       /* force deletion of expired entries... */
-       be->bd_info = (BackendInfo *)on->on_info;
-       rc = dds_expire( thrctx, di );
-       be->bd_info = (BackendInfo *)on;
-       if ( rc != LDAP_SUCCESS ) {
-               rc = 1;
-               goto done;
-       }
-
        /* ... so that count, if required, is accurate */
        if ( di->di_max_dynamicObjects > 0 ) {
+               /* force deletion of expired entries... */
+               be->bd_info = (BackendInfo *)on->on_info;
+               rc = dds_expire( thrctx, di );
+               be->bd_info = (BackendInfo *)on;
+               if ( rc != LDAP_SUCCESS ) {
+                       rc = 1;
+                       goto done;
+               }
+
                rc = dds_count( thrctx, be );
                if ( rc != LDAP_SUCCESS ) {
                        rc = 1;