]> git.sur5r.net Git - openldap/commitdiff
use back-config if supported
authorPierangelo Masarati <ando@openldap.org>
Tue, 4 Aug 2009 23:27:52 +0000 (23:27 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 4 Aug 2009 23:27:52 +0000 (23:27 +0000)
servers/slapd/overlays/pcache.c

index 024fb538b0697cbe24ebddab2a4c06560495ba5d..c40825d8362c32a0291ce914ac808601bd603c99 100644 (file)
@@ -3245,7 +3245,32 @@ pc_cf_gen( ConfigArgs *c )
                        return( 1 );
                }
 
-               if ( cm->db.be_config != NULL ) {
+               if ( cm->db.bd_info->bi_cf_ocs ) {
+                       ConfigTable     *ct;
+                       ConfigArgs      c2 = *c;
+                       char            *argv0 = c->argv[ 0 ];
+
+                       c->argv[ 0 ] = &argv0[ STRLENOF( "proxycache-" ) ];
+
+                       ct = config_find_keyword( cm->db.bd_info->bi_cf_ocs->co_table, c );
+                       if ( ct == NULL ) {
+                               rc = 1;
+
+                       } else {
+                               c->table = cm->db.bd_info->bi_cf_ocs->co_type;
+                               c->be = &cm->db;
+                               c->bi = c->be->bd_info;
+
+                               rc = config_add_vals( ct, c );
+
+                               c->bi = c2.bi;
+                               c->be = c2.be;
+                               c->table = c2.table;
+                       }
+
+                       c->argv[ 0 ] = argv0;
+
+               } else if ( cm->db.be_config != NULL ) {
                        char    *argv0 = c->argv[ 0 ];
 
                        c->argv[ 0 ] = &argv0[ STRLENOF( "proxycache-" ) ];