mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04: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:
parent
eb1c982e52
commit
491319c34c
1 changed files with 8 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue