Commit 491319c3 authored by Mark Andrews's avatar Mark Andrews
Browse files

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.
parent eb1c982e
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment