Date: Wed, 20 Jun 2007 10:54:22 GMT From: Fredrik Lindberg <fli@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 122025 for review Message-ID: <200706201054.l5KAsMZQ008693@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=122025 Change 122025 by fli@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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706201054.l5KAsMZQ008693>