From 3fea6802280d1b57768fe1b3983b8dffad693f9b Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Fri, 4 May 2007 06:56:37 +0000 Subject: [PATCH] Better estimate. git-svn-id: file:///svn/unbound/trunk@278 be551aaa-1e26-0410-a405-d3ace91eadb9 --- doc/Changelog | 3 +++ util/data/msgreply.c | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index 48fdd30f5..5217cec4e 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +4 May 2007: Wouter + - msgreply sizefunc is more accurate. + 3 May 2007: Wouter - fill refs. Use new parse and encode to answer queries. - stores rrsets in cache. diff --git a/util/data/msgreply.c b/util/data/msgreply.c index 94f7f5960..4d39058b7 100644 --- a/util/data/msgreply.c +++ b/util/data/msgreply.c @@ -476,9 +476,8 @@ msgreply_sizefunc(void* k, void* d) struct reply_info* r = (struct reply_info*)d; size_t s = sizeof(struct msgreply_entry) + sizeof(struct reply_info) + q->qnamesize; - if(r->rrset_count > 0) - s += r->rrset_count * (sizeof(struct ub_packed_rrset_key*) + - sizeof(struct rrset_ref)); + s += (r->rrset_count-1) * sizeof(struct rrset_ref); + s += r->rrset_count * sizeof(struct ub_packed_rrset_key*); return s; } -- 2.47.2