From 64e7f8541ddaee30c5e84394602eaeac69cb9b16 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Sat, 10 Feb 2001 01:18:19 +0000 Subject: [PATCH] optimization - if the compression table for a message is empty, don't hash and look up each label. --- lib/dns/compress.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/dns/compress.c b/lib/dns/compress.c index a3b68748a1..46d05780fc 100644 --- a/lib/dns/compress.c +++ b/lib/dns/compress.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: compress.c,v 1.45 2001/02/09 02:13:06 bwelling Exp $ */ +/* $Id: compress.c,v 1.46 2001/02/10 01:18:19 bwelling Exp $ */ #define DNS_NAME_USEINLINE 1 @@ -125,6 +125,9 @@ dns_compress_findglobal(dns_compress_t *cctx, dns_name_t *name, REQUIRE(dns_name_isabsolute(name) == ISC_TRUE); REQUIRE(offset != NULL); + if (cctx->count == 0) + return (ISC_FALSE); + labels = dns_name_countlabels(name); INSIST(labels > 0);