mirror of
https://github.com/miekg/dns.git
synced 2025-10-15 20:01:00 +02:00
fmt
This commit is contained in:
parent
d78c870779
commit
3a6edfa2c9
@ -142,7 +142,7 @@ func TestCompressLenght(t *testing.T) {
|
|||||||
m.SetQuestion("miek.nl", TypeMX)
|
m.SetQuestion("miek.nl", TypeMX)
|
||||||
ul := m.Len()
|
ul := m.Len()
|
||||||
m.Compress = true
|
m.Compress = true
|
||||||
if ul != m.Len(){
|
if ul != m.Len() {
|
||||||
t.Fatalf("Should be equal")
|
t.Fatalf("Should be equal")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
14
msg.go
14
msg.go
@ -222,7 +222,7 @@ func PackDomainName(s string, msg []byte, off int, compression map[string]int, c
|
|||||||
// Emit sequence of counted strings, chopping at dots.
|
// Emit sequence of counted strings, chopping at dots.
|
||||||
begin := 0
|
begin := 0
|
||||||
bs := []byte(s)
|
bs := []byte(s)
|
||||||
// ls := len(bs)
|
// ls := len(bs)
|
||||||
lens := ls
|
lens := ls
|
||||||
for i := 0; i < ls; i++ {
|
for i := 0; i < ls; i++ {
|
||||||
if bs[i] == '\\' {
|
if bs[i] == '\\' {
|
||||||
@ -247,18 +247,18 @@ func PackDomainName(s string, msg []byte, off int, compression map[string]int, c
|
|||||||
off++
|
off++
|
||||||
// TODO(mg): because of the new check above, this can go. But
|
// TODO(mg): because of the new check above, this can go. But
|
||||||
// just leave it as is for the moment.
|
// just leave it as is for the moment.
|
||||||
// if off > lenmsg {
|
// if off > lenmsg {
|
||||||
// return lenmsg, false
|
// return lenmsg, false
|
||||||
// }
|
// }
|
||||||
for j := begin; j < i; j++ {
|
for j := begin; j < i; j++ {
|
||||||
if off+1 > len(msg) {
|
if off+1 > len(msg) {
|
||||||
return lenmsg, false
|
return lenmsg, false
|
||||||
}
|
}
|
||||||
msg[off] = bs[j]
|
msg[off] = bs[j]
|
||||||
off++
|
off++
|
||||||
// if off > lenmsg {
|
// if off > lenmsg {
|
||||||
// return lenmsg, false
|
// return lenmsg, false
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
// Dont try to compress '.'
|
// Dont try to compress '.'
|
||||||
if compression != nil && string(bs[begin:]) != ".'" {
|
if compression != nil && string(bs[begin:]) != ".'" {
|
||||||
|
2
xfr.go
2
xfr.go
@ -141,8 +141,6 @@ func checkXfrSOA(in *Msg, first bool) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// XfrSend performs an outgoing [AI]xfr depending on the request message. The
|
// XfrSend performs an outgoing [AI]xfr depending on the request message. The
|
||||||
// caller is responsible for sending the correct sequence of RR sets through
|
// caller is responsible for sending the correct sequence of RR sets through
|
||||||
// the channel c. For reasons of symmetry XfrToken is re-used.
|
// the channel c. For reasons of symmetry XfrToken is re-used.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user