2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Shrink decompression contexts

It's wasteful to use 20 bytes and a pointer indirection to represent
two bits of information, so turn the struct into an enum. And change
the names of the enumeration constants to make the intent more clear.

This change introduces some inline functions into another header,
which confuses `gcovr` when it is trying to collect code coverage
statistics. So, in the CI job, copy more header files into a directory
where `gcovr` looks for them.
This commit is contained in:
Tony Finch
2022-05-05 16:36:52 +01:00
parent 129a522d88
commit 1d807d84f1
54 changed files with 115 additions and 211 deletions

View File

@@ -1263,7 +1263,6 @@ dns_client_addtrustedkey(dns_client_t *client, dns_rdataclass_t rdclass,
char rdatabuf[DST_KEY_MAXSIZE];
unsigned char digest[ISC_MAX_MD_SIZE];
dns_rdata_ds_t ds;
dns_decompress_t dctx;
dns_rdata_t rdata;
isc_buffer_t b;
@@ -1285,12 +1284,10 @@ dns_client_addtrustedkey(dns_client_t *client, dns_rdataclass_t rdclass,
}
isc_buffer_init(&b, rdatabuf, sizeof(rdatabuf));
dns_decompress_init(&dctx, DNS_DECOMPRESS_NONE);
dns_rdata_init(&rdata);
isc_buffer_setactive(databuf, isc_buffer_usedlength(databuf));
CHECK(dns_rdata_fromwire(&rdata, rdclass, rdtype, databuf, &dctx, 0,
&b));
dns_decompress_invalidate(&dctx);
CHECK(dns_rdata_fromwire(&rdata, rdclass, rdtype, databuf,
DNS_DECOMPRESS_NEVER, 0, &b));
if (rdtype == dns_rdatatype_ds) {
CHECK(dns_rdata_tostruct(&rdata, &ds, NULL));