path: root/src/cache.c
diff options
authorPablo Neira Ayuso <>2009-01-25 17:53:05 +0100
committerPablo Neira Ayuso <>2009-01-25 17:53:05 +0100
commit50c09dec9ad0261d8fcc18d69b2c9ec74052955c (patch)
tree143d7e278fc3f1688c60663be04f06ae2e98700f /src/cache.c
parent1c9faf8c218bc7ff4617557383e4116f1adb11e5 (diff)
src: add support for approximate timeout calculation during commit
During the commit phase, the entries in the external cache entries are inserted in the kernel conntrack table. Currently, we use a fixed timeout that is specified in the config file. With this patch, if you don't specify the fixed timeout value via CommitTimeout, the daemon calculates the real timeout value during the commit phase. Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'src/cache.c')
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cache.c b/src/cache.c
index 71825e1..318b8ec 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -249,7 +249,7 @@ static int __add(struct cache *c, struct cache_object *obj, int id)
c->extra->add(obj, ((char *) obj) + c->extra_offset);
- obj->lifetime = time(NULL);
+ obj->lifetime = obj->lastupdate = time(NULL);
obj->status = C_OBJ_NEW;
return 0;
@@ -287,6 +287,7 @@ void cache_update(struct cache *c, struct cache_object *obj, int id,
c->extra->update(obj, ((char *) obj) + c->extra_offset);
+ obj->lastupdate = time(NULL);
obj->status = C_OBJ_ALIVE;