More tests lenght
This commit is contained in:
parent
372e3d55c3
commit
0cba5240c3
8
msg.go
8
msg.go
|
@ -1615,9 +1615,11 @@ func compressionLenHelper(c map[string]int, s string) {
|
||||||
l += len(pref)
|
l += len(pref)
|
||||||
c[pref] = l
|
c[pref] = l
|
||||||
}
|
}
|
||||||
|
fmt.Printf("%+v -> %+v\n", s, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Look for each part in the compression map and returns its length
|
// Look for each part in the compression map and returns its length,
|
||||||
|
// keep on searching so we get the longest match.
|
||||||
func compressionLenSearch(c map[string]int, s string) (int, bool) {
|
func compressionLenSearch(c map[string]int, s string) (int, bool) {
|
||||||
off := 0
|
off := 0
|
||||||
end := false
|
end := false
|
||||||
|
@ -1632,13 +1634,15 @@ func compressionLenSearch(c map[string]int, s string) (int, bool) {
|
||||||
}
|
}
|
||||||
// TODO(miek): not sure if need, leave this for later debugging
|
// TODO(miek): not sure if need, leave this for later debugging
|
||||||
if _, ok := c[s[off:]]; ok {
|
if _, ok := c[s[off:]]; ok {
|
||||||
|
println("dns: not reached")
|
||||||
return len(s[off:]), true
|
return len(s[off:]), true
|
||||||
}
|
}
|
||||||
return 0, false
|
return 0, false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check the ownernames too of the types that have cdomain, do
|
// Check the ownernames too of the types that have cdomain, do
|
||||||
// this manually to avoid reflection.
|
// this manually to avoid reflection, and no new ones will be
|
||||||
|
// added (ever).
|
||||||
func compressionLenType(c map[string]int, r RR) int {
|
func compressionLenType(c map[string]int, r RR) int {
|
||||||
switch x := r.(type) {
|
switch x := r.(type) {
|
||||||
case *NS:
|
case *NS:
|
||||||
|
|
Loading…
Reference in New Issue