[dovecot-cvs] dovecot/src/auth auth-cache.c, 1.20, 1.21 auth-cache.h, 1.7, 1.8
tss at dovecot.org
tss at dovecot.org
Wed Nov 8 19:13:34 UTC 2006
Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv5359/src/auth
Modified Files:
auth-cache.c auth-cache.h
Log Message:
Add auth_cache_remove() function which will be used by OTP code to evict
old entries from auth cache. Patch by Andrey Panin.
Index: auth-cache.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-cache.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- auth-cache.c 15 Oct 2006 16:43:14 -0000 1.20
+++ auth-cache.c 8 Nov 2006 19:13:32 -0000 1.21
@@ -228,3 +228,22 @@
cache->size_left -= alloc_size;
hash_insert(cache->hash, node->data, node);
}
+
+void auth_cache_remove(struct auth_cache *cache,
+ const struct auth_request *request,
+ const char *key)
+{
+ string_t *str;
+ struct auth_cache_node *node;
+
+ str = t_str_new(256);
+ var_expand(str, key,
+ auth_request_get_var_expand_table(request,
+ auth_request_str_escape));
+
+ node = hash_lookup(cache->hash, str_c(str));
+ if (node == NULL)
+ return;
+
+ auth_cache_node_destroy(cache, node);
+}
Index: auth-cache.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-cache.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- auth-cache.h 13 Oct 2006 16:37:14 -0000 1.7
+++ auth-cache.h 8 Nov 2006 19:13:32 -0000 1.8
@@ -41,4 +41,9 @@
const struct auth_request *request,
const char *key, const char *value, bool last_success);
+/* Remove key from cache */
+void auth_cache_remove(struct auth_cache *cache,
+ const struct auth_request *request,
+ const char *key);
+
#endif
More information about the dovecot-cvs
mailing list