X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Foverlays%2Fpcache.c;h=81d195aa243bba624337494570865a4de03bb0c5;hb=5cf95c5b30ccfdb5ced35b31ac67b222ac5402af;hp=df9e17c776fb38c58985f207fc51195da64359e0;hpb=fde64826298681e2ebc90d3d286d74ff3b20bdbb;p=openldap diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index df9e17c776..81d195aa24 100644 --- a/servers/slapd/overlays/pcache.c +++ b/servers/slapd/overlays/pcache.c @@ -1,7 +1,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 2003-2006 The OpenLDAP Foundation. + * Copyright 2003-2008 The OpenLDAP Foundation. * Portions Copyright 2003 IBM Corporation. * Portions Copyright 2003 Symas Corporation. * All rights reserved. @@ -35,6 +35,19 @@ #include "config.h" +#ifdef LDAP_DEVEL +/* + * Control that allows to access the private DB + * instead of the public one + */ +#define PCACHE_CONTROL_PRIVDB "1.3.6.1.4.1.4203.666.11.9.5.1" + +/* + * Extended Operation that allows to remove a query from the cache + */ +#define PCACHE_EXOP_QUERY_DELETE "1.3.6.1.4.1.4203.666.11.9.6.1" +#endif + /* query cache structs */ /* query */ @@ -49,6 +62,7 @@ struct query_template_s; typedef struct Qbase_s { Avlnode *scopes[4]; /* threaded AVL trees of cached queries */ struct berval base; + int queries; } Qbase; /* struct representing a cached query */ @@ -58,14 +72,32 @@ typedef struct cached_query_s { Qbase *qbase; int scope; struct berval q_uuid; /* query identifier */ - struct query_template_s *qtemp; /* template of the query */ - time_t expiry_time; /* time till the query is considered valid */ + int q_sizelimit; + struct query_template_s *qtemp; /* template of the query */ + time_t expiry_time; /* time till the query is considered valid */ struct cached_query_s *next; /* next query in the template */ struct cached_query_s *prev; /* previous query in the template */ - struct cached_query_s *lru_up; /* previous query in the LRU list */ - struct cached_query_s *lru_down; /* next query in the LRU list */ + struct cached_query_s *lru_up; /* previous query in the LRU list */ + struct cached_query_s *lru_down; /* next query in the LRU list */ + ldap_pvt_thread_rdwr_t rwlock; } CachedQuery; +/* + * URL representation: + * + * ldap:///????x-uuid=,x-template=