PERFORCE change 122025 for review
Fredrik Lindberg
fli at FreeBSD.org
Wed Jun 20 10:54:23 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=122025
Change 122025 by fli at fli_genesis on 2007/06/20 10:54:09
- Follow record changes.
- If a ttl of 0 was given in cache_set_ttl() bump it up to 1.
Affected files ...
.. //depot/projects/soc2007/fli-mdns_sd/mdnsd/cache.c#2 edit
Differences ...
==== //depot/projects/soc2007/fli-mdns_sd/mdnsd/cache.c#2 (text+ko) ====
@@ -113,9 +113,8 @@
if (cr == NULL)
return;
MDNS_INIT_ASSERT(cr, cr_magic);
- if (--cr->cr_ttl_rel > 0) {
+ if (--cr->cr_ttl_rel > 0)
return;
- }
/* Remove entries with the same ttl */
do {
@@ -164,10 +163,10 @@
*new = rr;
}
else if (rrset->r_ttl > 0) {
- record_get(&c->c_recs, &r, rrset->r_name, RECORD_ALLOC);
+ record_get(&c->c_recs, &r, 0, rrset->r_name);
cr = malloc(sizeof(struct cache_res));
rr = &cr->cr_res;
- record_res_add(r, &rr, 0, rrset->r_type, rrset->r_data,
+ record_res_add(r, &rr, RECORD_NOALLOC, rrset->r_type, rrset->r_data,
rrset->r_datalen);
record_res_setparent(&cr->cr_res, cr);
cr->cr_ttl_abs = rrset->r_ttl;
@@ -283,6 +282,8 @@
{
struct cache_res *cr;
+ if (ttl == 0)
+ ttl++;
cr = record_res_getparent(rr);
dequeue_ttl(c, cr);
cr->cr_ttl_rel = ttl;
More information about the p4-projects
mailing list