X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Foverlays%2Fpcache.c;h=d27dcb7a0a7e176279f2e84aef65f980d8aec045;hb=2dd578221b3dbaf7ba2308b63c3cc46154323cae;hp=d91b6f327ccd5be368d8bb143034699d7ab84e9a;hpb=a9a50a6a3e2e1d78c29fc152b8d128424819655d;p=openldap diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index d91b6f327c..d27dcb7a0a 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-2009 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,13 @@ 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 */ + int bind_refcnt; /* number of bind operation referencing this query */ + 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 +98,7 @@ typedef struct cached_query_s { /* * URL representation: * - * ldap:///????x-uuid=,x-template=