summaryrefslogtreecommitdiffstats
path: root/cache.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-03-25 21:52:55 +0000
committerLennart Poettering <lennart@poettering.net>2005-03-25 21:52:55 +0000
commitad1f9d3725a300f10eca071c6fe2f2c583f51436 (patch)
tree2ee998675cf21060c657f6611aace02eb9c3e339 /cache.c
parentc8dd2dc8f91a322178c43281cbc5c8fc16da5219 (diff)
* add announcing/goodbye
* add cache maintaince * fix a bug in prioq.c git-svn-id: file:///home/lennart/svn/public/avahi/trunk@16 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'cache.c')
-rw-r--r--cache.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/cache.c b/cache.c
index 9025d1d..b668d33 100644
--- a/cache.c
+++ b/cache.c
@@ -6,6 +6,8 @@ static void remove_entry(flxCache *c, flxCacheEntry *e, gboolean remove_from_has
g_assert(c);
g_assert(e);
+ g_message("remvoin from cache: %p %p", c, e);
+
if (remove_from_hash_table) {
flxCacheEntry *t;
t = g_hash_table_lookup(c->hash_table, e->record->key);
@@ -24,14 +26,13 @@ static void remove_entry(flxCache *c, flxCacheEntry *e, gboolean remove_from_has
g_free(e);
}
-flxCache *flx_cache_new(flxServer *server, flxInterface *iface, guchar protocol) {
+flxCache *flx_cache_new(flxServer *server, flxInterface *iface) {
flxCache *c;
g_assert(server);
c = g_new(flxCache, 1);
c->server = server;
c->interface = iface;
- c->protocol = protocol;
c->hash_table = g_hash_table_new((GHashFunc) flx_key_hash, (GEqualFunc) flx_key_equal);
return c;
@@ -119,7 +120,7 @@ static void elapse_func(flxTimeEvent *t, void *userdata) {
g_message("Requesting cache entry update at %i%%.", percent);
/* Request a cache update */
- flx_interface_post_query(e->cache->interface, e->cache->protocol, e->record->key);
+ flx_interface_post_query(e->cache->interface, e->record->key);
/* Check again later */
next_expiry(e->cache, e, percent);
@@ -232,15 +233,10 @@ void flx_cache_drop_record(flxCache *c, flxRecord *r) {
static void func(gpointer key, gpointer data, gpointer userdata) {
flxCacheEntry *e = data;
flxKey *k = key;
+ gchar *t;
- gchar *s, *t;
-
- s = flx_key_to_string(k);
t = flx_record_to_string(e->record);
-
- fprintf((FILE*) userdata, "%s %s\n", s, t);
-
- g_free(s);
+ fprintf((FILE*) userdata, "%s\n", t);
g_free(t);
}