]> git.meshlink.io Git - catta/blobdiff - cache.h
* add subscription feature - with reissuing
[catta] / cache.h
diff --git a/cache.h b/cache.h
index 7f7d0bdc3bcd87d1f01c993919946957bb6e79ac..e7c8e7eab65a6e7ec4ad62d5077f06f5282205ad 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -9,18 +9,20 @@ typedef struct _flxCache flxCache;
 #include "prioq.h"
 #include "server.h"
 #include "llist.h"
+#include "timeeventq.h"
 
 typedef enum {
     FLX_CACHE_VALID,
     FLX_CACHE_EXPIRY1,
     FLX_CACHE_EXPIRY2,
-    FLX_CACHE_EXPIRY3
-        
+    FLX_CACHE_EXPIRY3,
+    FLX_CACHE_FINAL
 } flxCacheEntryState;
 
 typedef struct flxCacheEntry flxCacheEntry;
 
 struct flxCacheEntry {
+    flxCache *cache;
     flxRecord *record;
     GTimeVal timestamp;
     GTimeVal expiry;
@@ -28,11 +30,9 @@ struct flxCacheEntry {
     flxAddress origin;
 
     flxCacheEntryState state;
+    flxTimeEvent *time_event;
 
     FLX_LLIST_FIELDS(flxCacheEntry, by_name);
-
-    flxPrioQueueNode *node;
-    
 };
 
 struct _flxCache {
@@ -49,7 +49,7 @@ void flx_cache_free(flxCache *c);
 flxCacheEntry *flx_cache_lookup_key(flxCache *c, flxKey *k);
 flxCacheEntry *flx_cache_lookup_record(flxCache *c, flxRecord *r);
 
-flxCacheEntry *flx_cache_update(flxCache *c, flxRecord *r, gboolean unique, const flxAddress *a);
+void flx_cache_update(flxCache *c, flxRecord *r, gboolean unique, const flxAddress *a);
 
 void flx_cache_drop_key(flxCache *c, flxKey *k);
 void flx_cache_drop_record(flxCache *c,  flxRecord *r);