Commit Graph

15 Commits

Author SHA1 Message Date
Miek Gieben
c67fc3a2a1 Add more tests for the labels 2013-09-12 09:18:54 +01:00
Miek Gieben
9764818db3 Make CountLabel faster
We don't need an allocation here, it works ok for non-fqdns and fqdns
2013-09-12 09:11:19 +01:00
Miek Gieben
08e7365dc2 Make SplitLabels faster
don't allocate a new string at all, it does not matter is the given
string is not fully qualified.
2013-09-12 08:57:37 +01:00
Miek Gieben
9c1ee5d5ca Update IsDomainName
This new functions just compiles the domain to wire format, if that
works, the name is deemed OK. It is also much less strict than the
older code. Almost everything is allowed in the name, except two
dots back to back (there is an explicit test for that).
2013-09-10 18:09:22 +00:00
Miek Gieben
db41985b91 copy the optimization from go tip into here 2013-08-23 18:41:35 +00:00
Ray Bejjani
9d2d8b36eb SplitDomainName handles non-FQDN labels correctly, doesn't return '.' in parts.
SplitDomainName would always include the '.' after each label segment. This was
inconsistent with the "." case (were it returned nil) and didn't seem too useful
since it required more processing to remove the '.' (like when building a
compression dictionary in Msg.Len() or Msg.Pack()). It also had issues with the
last segment, not including it in the split. It now returns all segments,
including the last, irrespective of the label being fully qualified.
A test has also been added to ensure no regressions.
2013-06-25 10:53:30 -07:00
Miek Gieben
76db7d1a62 add benchmarking 2013-06-22 09:40:00 +01:00
Miek Gieben
9762efef1e Use new names 2013-06-22 08:48:26 +01:00
Miek Gieben
2b65c92022 Merge branch 'master' of github.com:miekg/dns 2013-06-22 08:45:58 +01:00
Miek Gieben
bb732937a2 Add Benchmarking functions 2013-06-22 08:40:02 +01:00
Miek Gieben
38ea608d79 Rename the Label* functions
SplitLabels -> SplitDomainName
CompareLabels -> CompareDomainName
LenLabels -> CountLabel
          -> NextLabel was added as a simple iterator-like function
2013-06-22 07:21:15 +00:00
Miek Gieben
9640d43c82 Make SplitLabels use Split 2013-06-21 15:17:12 +00:00
Miek Gieben
a16b289765 Add todo 2013-06-20 20:36:13 +00:00
Miek Gieben
f595bf7a06 Set license on test files 2013-05-12 16:09:52 +02:00
Miek Gieben
1bcfaec67f more radix stuff 2012-08-01 07:30:45 -07:00