mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +00:00
1526. [func] Implemented "additional section caching (or acache)",
an internal cache framework for additional section content to improve response performance. Several configuration options were provided to control the behavior.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: rdataset.c,v 1.72 2004/03/05 05:09:23 marka Exp $ */
|
||||
/* $Id: rdataset.c,v 1.73 2004/12/21 10:45:17 jinmei Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -174,6 +174,9 @@ static dns_rdatasetmethods_t question_methods = {
|
||||
question_clone,
|
||||
question_count,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -624,3 +627,81 @@ dns_rdataset_getnoqname(dns_rdataset_t *rdataset, dns_name_t *name,
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
return((rdataset->methods->getnoqname)(rdataset, name, nsec, nsecsig));
|
||||
}
|
||||
|
||||
/*
|
||||
* Additional cache stuff
|
||||
*/
|
||||
isc_result_t
|
||||
dns_rdataset_getadditional(dns_rdataset_t *rdataset,
|
||||
dns_rdatasetadditional_t type,
|
||||
dns_rdatatype_t qtype,
|
||||
dns_acache_t *acache,
|
||||
dns_zone_t **zonep,
|
||||
dns_db_t **dbp,
|
||||
dns_dbversion_t **versionp,
|
||||
dns_dbnode_t **nodep,
|
||||
dns_name_t *fname,
|
||||
dns_message_t *msg,
|
||||
isc_stdtime_t now)
|
||||
{
|
||||
REQUIRE(DNS_RDATASET_VALID(rdataset));
|
||||
REQUIRE(rdataset->methods != NULL);
|
||||
REQUIRE(zonep == NULL || *zonep == NULL);
|
||||
REQUIRE(dbp != NULL && *dbp == NULL);
|
||||
REQUIRE(versionp != NULL && *versionp == NULL);
|
||||
REQUIRE(nodep != NULL && *nodep == NULL);
|
||||
REQUIRE(fname != NULL);
|
||||
REQUIRE(msg != NULL);
|
||||
|
||||
if (acache != NULL && rdataset->methods->getadditional != NULL) {
|
||||
return ((rdataset->methods->getadditional)(rdataset, type,
|
||||
qtype, acache,
|
||||
zonep, dbp,
|
||||
versionp, nodep,
|
||||
fname, msg, now));
|
||||
}
|
||||
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_rdataset_setadditional(dns_rdataset_t *rdataset,
|
||||
dns_rdatasetadditional_t type,
|
||||
dns_rdatatype_t qtype,
|
||||
dns_acache_t *acache,
|
||||
dns_zone_t *zone,
|
||||
dns_db_t *db,
|
||||
dns_dbversion_t *version,
|
||||
dns_dbnode_t *node,
|
||||
dns_name_t *fname)
|
||||
{
|
||||
REQUIRE(DNS_RDATASET_VALID(rdataset));
|
||||
REQUIRE(rdataset->methods != NULL);
|
||||
|
||||
if (acache != NULL && rdataset->methods->setadditional != NULL) {
|
||||
return ((rdataset->methods->setadditional)(rdataset, type,
|
||||
qtype, acache, zone,
|
||||
db, version,
|
||||
node, fname));
|
||||
}
|
||||
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_rdataset_putadditional(dns_acache_t *acache,
|
||||
dns_rdataset_t *rdataset,
|
||||
dns_rdatasetadditional_t type,
|
||||
dns_rdatatype_t qtype)
|
||||
{
|
||||
REQUIRE(DNS_RDATASET_VALID(rdataset));
|
||||
REQUIRE(rdataset->methods != NULL);
|
||||
|
||||
if (acache != NULL && rdataset->methods->putadditional != NULL) {
|
||||
return ((rdataset->methods->putadditional)(acache, rdataset,
|
||||
type, qtype));
|
||||
}
|
||||
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user