Attach and detach from the db.
Simplify the API by not requiring the name to be specfied for add and remove,
and by not requiring the db to be specified for removedefault.
Calls to dns_rbt_findname were failing because stored_data was not initialized
to NULL.
The commit_ok and changed_list were sometimes being accessed without
holding the lock.
Comments in structure.
Do not allow an rdataset to be added to a non-writer version.
Do not allow closeversion() to commit a writer version unless the ref count
is one.
We were not incrementing the version ref count when creating an rdataset
iterator.
what happens at ".". For most origins, they do NOT include themself in
a zone file ... that is, the record for "rc" appears in the $ORIGIN for
".vix.com."
rollback_node() incorrectly required that node->references == 0. We cannot
assume that a node has no references when an update is rolled back. We now
mark any rolled back rdatasets with the RDATASET_ATTR_IGNORE attribute. When
the node eventually has a zero reference count, IGNOREd rdatasets will be
cleaned up. In the meantime, they will be ignored.
point. Specifically, we return a delegation in this case, except if glue is
OK, or if the caller is looking for NXT or KEY records.
SIG records are going to be a special case, so do not deal with them in the
zone find routine.
sometimes did not find the deepest zone cut. E.g. If you look for A records at
"com." then you should get a delegation for "com." and not one for ".".
In the various rdataset find routines, we sometimes attempted to bind the
rdataset even if the rdataset pointer was NULL.
Remove inline from a few functions. Add inline to a few others.
Add incomplete and not-yet-working dbiterator implementation.
Improve node reference count handling.
Opening and closing the current version more than once was breaking
due to incorrect garbage collection.
Some rbtdb values had not been getting initialized.
Improvements to add procedure.
I added support for the full search algorithm to the RBT database
code. The database has some special needs in searching, in particular
certain nodes need to be examined before the DOWN pointer is followed.
I solved this problem by adding a 'callback' bit to the node structure.
When findnode is called, the caller can supply a callback. Before we go
DOWN at a node, we call the callback if the callback bit is set at the
node. If the callback returns DNS_R_CONTINUE, we proceed. Otherwise, we
will stop right there and return what the caller said to return. I
added an 'empty_data_ok' flag to findnode as well, so that nodes with
empty data can be made candidates for partial match status.
I also wanted to make dns_rbtnodechain_t public, so that a chain could
be allocated on the stack by the caller. I added two routines,
dns_rbtnodechain_init() and dns_rbtnodechain_reset() to work with them.
The latter routine frees any dynamically allocated memory associated with
the chain. The chain structure now contains the memory context. I also
moved get_ancestor_mem() and put_ancestor_mem() up in the file, so that
inlining could be more effective.
In the nits department, you wrote
*node = result == DNS_R_SUCCESS ? current : NULL;
In the future, please write this instead (the patch has this change in it):
if (result == DNS_R_SUCCESS)
*node = current;
else
*node = NULL;
is currently fine, because there are only two attribute flags a name
can have, one of which the node definitely needs to have set, and the
other of which is functionally irrelevant (because it happens to be set
by the NODENAME macro, namely the read-only flag). This might not
be the right thing to do in the future when more name attributes get
added, but we'll cross that bridge if we get to it. (_Some_ change was
necessary because the node's attributes was not properly initialized when
created, and under certain circumstances this ended up triggering an
exception in the dns_name_* functions.
Watch for level overflow during dns_rbt_addnode(). Returns DNS_R_NOSPACE,
which is probably not the right thing.
Comment cleanups.