BIND 10 #2052: dns::LabelSequence::compare()
BIND 10 Development
do-not-reply at isc.org
Thu Jun 28 04:31:47 UTC 2012
#2052: dns::LabelSequence::compare()
-------------------------------------+-------------------------------------
Reporter: | Owner: vorner
jinmei | Status: reviewing
Type: task | Milestone:
Priority: | Sprint-20120703
medium | Resolution:
Component: | Sensitive: 0
libdns++ | Sub-Project: DNS
Keywords: | Estimated Difficulty: 4
Defect Severity: N/A | Total Hours: 0
Feature Depending on Ticket: |
Add Hours to Ticket: 0 |
Internal?: 0 |
-------------------------------------+-------------------------------------
Changes (by muks):
* owner: muks => vorner
Comment:
Hi vorner
Replying to [comment:5 vorner]:
> First, I'd like to ask ‒ there's no relation between absolute and non-
absolute name. But what about two non-absolute ones? Comparing "www" to
"www" will return NONE. Is it what we want?
It seems this is not we want after discussion with Jinmei on jabber. I've
added several more unit tests and updated the code to compare non-absolute
label sequences properly.
> Also, this comment is not true (in the documentation of
`partial_compare`):
> {{{#!c++
> /// This method never throws an exception.
> }}}
>
> because of this:
> {{{#!c++
> if ((first_label > labelcount_) ||
> (first_label_other > other.labelcount_)) {
> isc_throw(BadValue, "Bad first label indices were passed");
> }
> }}}
Fixed. :)
> And, finally, I wanted to point out that we planned to extend the
LabelSequence so it would be possible to be built on top of raw data
instead of the Name object. I think we'll be using these in the new in-
memory implementation. But then, this will not work. Would it be possible
to modify the Name and the LabelSequence so that the `partial_match` code
works both for the Name and for the internal data structures of
LabelSequence, so the LabelSequence::compare would not use the Name object
there?
There is no current internal data structure of LabelSequence specific to
it (it uses Name). This is why Name's `compare()` was modified to
`partial_compare()` and reused. I think suggested changes are best done
after LabelSequence is itself modified as part of the larger changes. The
changes required at that point would be straightforward.
--
Ticket URL: <http://bind10.isc.org/ticket/2052#comment:7>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list