It wasn't that chain->end was being included (it should have been) but
that the chain had already been expanded to point down a level before
the call to chain_name that needed the state of things before the
descent.
comparison is "subdomain" but the full name at the existing node is
not in common with the input name -- when the last label is a bitstring
with some common bits.
in a lot of places now. It _returns_ if it fails to get the necessary memory,
so any function using it should be returning a dns_result_t.
chain_name moved toward start of file, for inlining by findnode.
move_chain_to_last broke out some functionality of dns_rbtnodechain_last
(which now calls it), also for the benefit of findnode.
dns_rbtnodechain_init on the chain used by addnode.
All of the new_foundname concatenation gook was removed from findnode,
which now just sets foundname by using chain_name.
The chain set up by findnode points to the predecessor when the searched
for name is not found.
nodechain_current was changed to take name, origin and node parameters while
returning a dns_result_t. This allows the chain returned by findnode to
be named.
The nodechain_{first,last,prev} use nodechain_current to set their
names and origins. nodechain_next does not need it because it will never
have to do the "set the origin to '.' and remove '.' from names in the
root level" bit. The root level will never be more than one name, and
everything in the megatree is a successor to that node, so 'next' never
reaches the root level.
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.