]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/pcache.c
Merge remote-tracking branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_5
[openldap] / servers / slapd / overlays / pcache.c
index 6971694282bcf848b42882deb94b1a581245157c..84c9d237a94125de0b624d70fa4b63509e6ff5da 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2003-2012 The OpenLDAP Foundation.
+ * Copyright 2003-2014 The OpenLDAP Foundation.
  * Portions Copyright 2003 IBM Corporation.
  * Portions Copyright 2003-2009 Symas Corporation.
  * All rights reserved.
@@ -37,7 +37,6 @@
 
 #include "config.h"
 
-#ifdef LDAP_DEVEL
 /*
  * Control that allows to access the private DB
  * instead of the public one
@@ -53,7 +52,6 @@
  * Monitoring
  */
 #define PCACHE_MONITOR
-#endif
 
 /* query cache structs */
 /* query */
@@ -2438,6 +2436,7 @@ pcache_response(
 
        if ( si->swap_saved_attrs ) {
                rs->sr_attrs = si->save_attrs;
+               rs->sr_attr_flags = slap_attr_flags( si->save_attrs );
                op->ors_attrs = si->save_attrs;
        }
 
@@ -2793,17 +2792,16 @@ pcache_op_privdb(
        /* map tag to operation */
        type = slap_req2op( op->o_tag );
        if ( type != SLAP_OP_LAST ) {
-               BI_op_func      **func;
+               BackendInfo     *bi = cm->db.bd_info;
                int             rc;
 
                /* execute, if possible */
-               func = &cm->db.be_bind;
-               if ( func[ type ] != NULL ) {
+               if ( (&bi->bi_op_bind)[ type ] ) {
                        Operation       op2 = *op;
        
                        op2.o_bd = &cm->db;
 
-                       rc = func[ type ]( &op2, rs );
+                       rc = (&bi->bi_op_bind)[ type ]( &op2, rs );
                        if ( type == SLAP_OP_BIND && rc == LDAP_SUCCESS ) {
                                op->o_conn->c_authz_cookie = cm->db.be_private;
                        }
@@ -3210,6 +3208,10 @@ get_attr_set(
                int found = 1;
 
                if ( count > qm->attr_sets[i].count ) {
+                       if ( qm->attr_sets[i].count &&
+                               bvmatch( &qm->attr_sets[i].attrs[0].an_name, slap_bv_all_user_attrs )) {
+                               break;
+                       }
                        continue;
                }
 
@@ -3655,6 +3657,7 @@ static ConfigTable pccfg[] = {
                2, 0, 0, ARG_MAGIC|PC_ATTR, pc_cf_gen,
                "( OLcfgOvAt:2.2 NAME ( 'olcPcacheAttrset' 'olcProxyAttrset' ) "
                        "DESC 'A set of attributes to cache' "
+                       "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "pcacheTemplate", "filter> <attrset-index> <TTL> <negTTL> "
                        "<limitTTL> <TTR",
@@ -3663,36 +3666,38 @@ static ConfigTable pccfg[] = {
                        "DESC 'Filter template, attrset, cache TTL, "
                                "optional negative TTL, optional sizelimit TTL, "
                                "optional TTR' "
+                       "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "pcachePosition", "head|tail(default)",
                2, 2, 0, ARG_MAGIC|PC_RESP, pc_cf_gen,
                "( OLcfgOvAt:2.4 NAME 'olcPcachePosition' "
                        "DESC 'Response callback position in overlay stack' "
-                       "SYNTAX OMsDirectoryString )", NULL, NULL },
+                       "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "pcacheMaxQueries", "queries",
                2, 2, 0, ARG_INT|ARG_MAGIC|PC_QUERIES, pc_cf_gen,
                "( OLcfgOvAt:2.5 NAME ( 'olcPcacheMaxQueries' 'olcProxyCacheQueries' ) "
                        "DESC 'Maximum number of queries to cache' "
-                       "SYNTAX OMsInteger )", NULL, NULL },
+                       "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
        { "pcachePersist", "TRUE|FALSE",
                2, 2, 0, ARG_ON_OFF|ARG_OFFSET, (void *)offsetof(cache_manager, save_queries),
                "( OLcfgOvAt:2.6 NAME ( 'olcPcachePersist' 'olcProxySaveQueries' ) "
                        "DESC 'Save cached queries for hot restart' "
-                       "SYNTAX OMsBoolean )", NULL, NULL },
+                       "SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
        { "pcacheValidate", "TRUE|FALSE",
                2, 2, 0, ARG_ON_OFF|ARG_OFFSET, (void *)offsetof(cache_manager, check_cacheability),
                "( OLcfgOvAt:2.7 NAME ( 'olcPcacheValidate' 'olcProxyCheckCacheability' ) "
                        "DESC 'Check whether the results of a query are cacheable, e.g. for schema issues' "
-                       "SYNTAX OMsBoolean )", NULL, NULL },
+                       "SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
        { "pcacheOffline", "TRUE|FALSE",
                2, 2, 0, ARG_ON_OFF|ARG_MAGIC|PC_OFFLINE, pc_cf_gen,
                "( OLcfgOvAt:2.8 NAME 'olcPcacheOffline' "
                        "DESC 'Set cache to offline mode and disable expiration' "
-                       "SYNTAX OMsBoolean )", NULL, NULL },
+                       "SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
        { "pcacheBind", "filter> <attrset-index> <TTR> <scope> <base",
                6, 6, 0, ARG_MAGIC|PC_BIND, pc_cf_gen,
                "( OLcfgOvAt:2.9 NAME 'olcPcacheBind' "
                        "DESC 'Parameters for caching Binds' "
+                       "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "pcache-", "private database args",
                1, 0, STRLENOF("pcache-"), ARG_MAGIC|PC_PRIVATE_DB, pc_cf_gen,