summaryrefslogtreecommitdiffstats
path: root/src/cache.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2009-01-25 17:53:05 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>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 <pablo@netfilter.org>
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c3
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);
c->stats.active++;
- obj->lifetime = time(NULL);
+ obj->lifetime = obj->lastupdate = time(NULL);
obj->status = C_OBJ_NEW;
obj->refcnt++;
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);
c->stats.upd_ok++;
+ obj->lastupdate = time(NULL);
obj->status = C_OBJ_ALIVE;
}