mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
improvements to the QP iterator
- make iterators reversible: refactor dns_qpiter_next() and add a new dns_qpiter_prev() function to support iterating both forwards and backwards through a QP trie. - added a 'name' parameter to dns_qpiter_next() (as well as _prev()) to make it easier to retrieve the nodename while iterating, without having to construct it from pointer value data.
This commit is contained in:
@@ -480,7 +480,7 @@ dns_ntatable_totext(dns_ntatable_t *ntatable, const char *view,
|
||||
dns_qpmulti_query(ntatable->table, &qpr);
|
||||
dns_qpiter_init(&qpr, &iter);
|
||||
|
||||
while (dns_qpiter_next(&iter, &pval, NULL) == ISC_R_SUCCESS) {
|
||||
while (dns_qpiter_next(&iter, NULL, &pval, NULL) == ISC_R_SUCCESS) {
|
||||
dns__nta_t *n = pval;
|
||||
char nbuf[DNS_NAME_FORMATSIZE];
|
||||
char tbuf[ISC_FORMATHTTPTIMESTAMP_SIZE];
|
||||
@@ -536,7 +536,7 @@ dns_ntatable_save(dns_ntatable_t *ntatable, FILE *fp) {
|
||||
dns_qpmulti_query(ntatable->table, &qpr);
|
||||
dns_qpiter_init(&qpr, &iter);
|
||||
|
||||
while (dns_qpiter_next(&iter, &pval, NULL) == ISC_R_SUCCESS) {
|
||||
while (dns_qpiter_next(&iter, NULL, &pval, NULL) == ISC_R_SUCCESS) {
|
||||
dns__nta_t *n = pval;
|
||||
isc_buffer_t b;
|
||||
char nbuf[DNS_NAME_FORMATSIZE + 1], tbuf[80];
|
||||
@@ -620,7 +620,7 @@ dns_ntatable_shutdown(dns_ntatable_t *ntatable) {
|
||||
ntatable->shuttingdown = true;
|
||||
|
||||
dns_qpiter_init(&qpr, &iter);
|
||||
while (dns_qpiter_next(&iter, &pval, NULL) == ISC_R_SUCCESS) {
|
||||
while (dns_qpiter_next(&iter, NULL, &pval, NULL) == ISC_R_SUCCESS) {
|
||||
dns__nta_t *n = pval;
|
||||
dns__nta_shutdown(n);
|
||||
dns__nta_detach(&n);
|
||||
|
Reference in New Issue
Block a user