2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

dbiterator_pause (dns_dbiterator_pause) can now pause a interator after

hitting end of chain.  If we have a node increase its reference count
and set paused flag.
This commit is contained in:
Mark Andrews 1999-12-22 03:01:02 +00:00
parent eb1c982e52
commit 491319c34c

View File

@ -4455,18 +4455,20 @@ dbiterator_pause(dns_dbiterator_t *iterator) {
rbtdb_dbiterator_t *rbtdbiter = (rbtdb_dbiterator_t *)iterator;
dns_rbtnode_t *node = rbtdbiter->node;
if (rbtdbiter->result != DNS_R_SUCCESS)
if (rbtdbiter->result != DNS_R_SUCCESS &&
rbtdbiter->result != DNS_R_NOMORE)
return (rbtdbiter->result);
REQUIRE(!rbtdbiter->paused);
REQUIRE(rbtdbiter->tree_locked);
REQUIRE(node != NULL);
LOCK(&rbtdb->node_locks[node->locknum].lock);
new_reference(rbtdb, node);
UNLOCK(&rbtdb->node_locks[node->locknum].lock);
if (node != NULL) {
LOCK(&rbtdb->node_locks[node->locknum].lock);
new_reference(rbtdb, node);
UNLOCK(&rbtdb->node_locks[node->locknum].lock);
rbtdbiter->paused = ISC_TRUE;
rbtdbiter->paused = ISC_TRUE;
}
RWUNLOCK(&rbtdb->tree_lock, isc_rwlocktype_read);
rbtdbiter->tree_locked = ISC_FALSE;