PERFORCE change 124744 for review
Fredrik Lindberg
fli at FreeBSD.org
Sun Aug 5 11:29:47 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=124744
Change 124744 by fli at fli_nexus on 2007/08/05 18:28:58
- Add cache_flush() that flushes all entries in the cache.
- Whitespace fixes.
Affected files ...
.. //depot/projects/soc2007/fli-mdns_sd/mdnsd/cache.c#5 edit
Differences ...
==== //depot/projects/soc2007/fli-mdns_sd/mdnsd/cache.c#5 (text+ko) ====
@@ -85,7 +85,7 @@
{
records_init(&c->c_recs, mdns_c_in);
TAILQ_INIT(&c->c_list);
- c->c_queries = q;
+ c->c_queries = q;
}
void
@@ -213,7 +213,7 @@
rs.r_ttl = 0;
rs.r_class = mdns_c_in;
rs.r_type = rt->rt_type;
- rs.r_data = rr->rr_data;
+ rs.r_data = rr->rr_data;
rs.r_datalen = rr->rr_len;
query_notify(c->c_queries, &rs, 0, 0, 0);
}
@@ -310,3 +310,18 @@
cr->cr_ttl_rel = ttl;
enqueue_ttl(c, cr);
}
+
+/*
+ * Flush all cache entries ignoring TTL
+ * c - Cache handle
+ */
+void
+cache_flush(struct cache *c)
+{
+ struct cache_res *cr, *cr2;
+
+ TAILQ_FOREACH_SAFE(cr, &c->c_list, cr_next, cr2) {
+ cache_del(c, &cr->cr_res);
+ }
+ dprintf(DEBUG_CACHE, "Flushed all cache entries c=%x", c);
+}
More information about the p4-projects
mailing list