]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Better estimate.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 4 May 2007 06:56:37 +0000 (06:56 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 4 May 2007 06:56:37 +0000 (06:56 +0000)
git-svn-id: file:///svn/unbound/trunk@278 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
util/data/msgreply.c

index 48fdd30f50c60526c0add0b76d9f8b24dc871ed5..5217cec4e3108f8bbdcefcaffb4f81b2e1050174 100644 (file)
@@ -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.
index 94f7f5960b3828741404d61d69c2ef47cf9079f4..4d39058b7f45bfc0c81641a40b4c682bdf82fc21 100644 (file)
@@ -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;
 }