From da526faa4a18a0028d3b4d92473bfb7755f00d88 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9s=20J=2E=20D=C3=ADaz?= Date: Sat, 20 Jun 2009 12:49:34 +0200 Subject: [PATCH] src/utils_cache.c: Fix OKAY notifications for missing values. --- src/utils_cache.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/utils_cache.c b/src/utils_cache.c index 2995501a..5f7181b0 100644 --- a/src/utils_cache.c +++ b/src/utils_cache.c @@ -303,7 +303,18 @@ int uc_check_timeout (void) sfree (key); cache_free (ce); } - else if (status == 2) /* persist */ + + /* If we get here, the value is ``interesting''. Query the record from the + * cache and update the state field. */ + if (c_avl_get (cache_tree, keys[i], (void *) &ce) != 0) + { + ERROR ("uc_check_timeout: cannot get data for %s from cache", keys[i]); + /* Do not free `keys[i]' so a notification is sent further down. */ + continue; + } + assert (ce != NULL); + + if (status == 2) /* persist */ { DEBUG ("uc_check_timeout: %s is missing, sending notification.", keys[i]); -- 2.30.2