From 3a6edfa2c9c54926909599131657f2f43d88cf2a Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Mon, 10 Sep 2012 20:51:19 +0200 Subject: [PATCH] fmt --- dns_test.go | 2 +- msg.go | 16 ++++++++-------- nsecx.go | 2 +- types.go | 6 +++--- xfr.go | 2 -- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/dns_test.go b/dns_test.go index 6b1b30b2..581df99d 100644 --- a/dns_test.go +++ b/dns_test.go @@ -142,7 +142,7 @@ func TestCompressLenght(t *testing.T) { m.SetQuestion("miek.nl", TypeMX) ul := m.Len() m.Compress = true - if ul != m.Len(){ + if ul != m.Len() { t.Fatalf("Should be equal") } } diff --git a/msg.go b/msg.go index 5c24625d..bbe82517 100644 --- a/msg.go +++ b/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. begin := 0 bs := []byte(s) -// ls := len(bs) + // ls := len(bs) lens := ls for i := 0; i < ls; i++ { if bs[i] == '\\' { @@ -239,7 +239,7 @@ func PackDomainName(s string, msg []byte, off int, compression map[string]int, c } // off can already (we're in a loop) be bigger than len(msg) // this happens when a name isn't fully qualified - if off+1 > len(msg) { + if off+1 > len(msg) { return lenmsg, false } msg[off] = byte(i - begin) @@ -247,18 +247,18 @@ func PackDomainName(s string, msg []byte, off int, compression map[string]int, c off++ // TODO(mg): because of the new check above, this can go. But // just leave it as is for the moment. -// if off > lenmsg { -// return lenmsg, false -// } + // if off > lenmsg { + // return lenmsg, false + // } for j := begin; j < i; j++ { if off+1 > len(msg) { return lenmsg, false } msg[off] = bs[j] off++ -// if off > lenmsg { -// return lenmsg, false -// } + // if off > lenmsg { + // return lenmsg, false + // } } // Dont try to compress '.' if compression != nil && string(bs[begin:]) != ".'" { diff --git a/nsecx.go b/nsecx.go index 6e748650..5c9e15b3 100644 --- a/nsecx.go +++ b/nsecx.go @@ -117,7 +117,7 @@ func (rr *RR_NSEC) MatchType(rrtype uint16) bool { func (rr *RR_NSEC3) Cover(domain string) bool { hashdom := strings.ToUpper(HashName(domain, rr.Hash, rr.Iterations, rr.Salt)) nextdom := strings.ToUpper(rr.NextDomain) - owner := strings.ToUpper(SplitLabels(rr.Header().Name)[0]) // The hashed part + owner := strings.ToUpper(SplitLabels(rr.Header().Name)[0]) // The hashed part apex := strings.ToUpper(HashName(strings.Join(SplitLabels(rr.Header().Name)[1:], "."), rr.Hash, rr.Iterations, rr.Salt)) + "." // The name of the zone // if nextdomain equals the apex, it is considered The End. So in that case hashdom is always less then nextdomain if hashdom > owner && nextdom == apex { diff --git a/types.go b/types.go index 8d0eb140..a1713c0b 100644 --- a/types.go +++ b/types.go @@ -72,9 +72,9 @@ const ( TypeMAILA uint16 = 254 TypeANY uint16 = 255 - TypeURI uint16 = 256 - TypeTA uint16 = 32768 - TypeDLV uint16 = 32769 + TypeURI uint16 = 256 + TypeTA uint16 = 32768 + TypeDLV uint16 = 32769 // valid Question.Qclass ClassINET = 1 diff --git a/xfr.go b/xfr.go index c861ebc2..63ab3bb0 100644 --- a/xfr.go +++ b/xfr.go @@ -141,8 +141,6 @@ func checkXfrSOA(in *Msg, first bool) bool { return false } - - // XfrSend performs an outgoing [AI]xfr depending on the request message. The // caller is responsible for sending the correct sequence of RR sets through // the channel c. For reasons of symmetry XfrToken is re-used.