X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Foverlays%2Fpcache.c;h=75ab887bdf6e9edaed0502ad648f3de87b1e07d7;hb=200af921f4f1de43d89ba587d711ee9fc739e1bb;hp=700043e305f3e0e4c66ef3583f9edf67aaacbfef;hpb=294da7ed11a9a5721b15d0ed81682f123e20cbb0;p=openldap diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index 700043e305..75ab887bdf 100644 --- a/servers/slapd/overlays/pcache.c +++ b/servers/slapd/overlays/pcache.c @@ -1,9 +1,9 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 2003-2008 The OpenLDAP Foundation. + * Copyright 2003-2011 The OpenLDAP Foundation. * Portions Copyright 2003 IBM Corporation. - * Portions Copyright 2003 Symas Corporation. + * Portions Copyright 2003-2009 Symas Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,6 +33,8 @@ #include "ldap_rq.h" #include "avl.h" +#include "../back-monitor/back-monitor.h" + #include "config.h" #ifdef LDAP_DEVEL @@ -46,6 +48,11 @@ * 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" + +/* + * Monitoring + */ +#define PCACHE_MONITOR #endif /* query cache structs */ @@ -74,7 +81,12 @@ typedef struct cached_query_s { struct berval q_uuid; /* query identifier */ int q_sizelimit; struct query_template_s *qtemp; /* template of the query */ - time_t expiry_time; /* time till the query is considered valid */ + time_t expiry_time; /* time till the query is considered invalid */ + time_t refresh_time; /* time till the query is refreshed */ + time_t bindref_time; /* time till the bind is refreshed */ + unsigned long answerable_cnt; /* how many times it was answerable */ + int refcnt; /* references since last refresh */ + ldap_pvt_thread_mutex_t answerable_cnt_mutex; 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 */ @@ -85,7 +97,7 @@ typedef struct cached_query_s { /* * URL representation: * - * ldap:///????x-uuid=,x-template=