Remove needless blank line

This commit is contained in:
kenshinx 2015-02-11 17:11:32 +08:00
parent ed0dd3006c
commit f32122d875
1 changed files with 7 additions and 12 deletions

View File

@ -7,18 +7,18 @@ import (
"github.com/miekg/dns"
)
type Question struct {
qname string
qtype string
qclass string
}
const (
notIPQuery = 0
_IP4Query = 4
_IP6Query = 6
)
type Question struct {
qname string
qtype string
qclass string
}
func (q *Question) String() string {
return q.qname + " " + q.qclass + " " + q.qtype
}
@ -117,10 +117,9 @@ func (h *GODNSHandler) do(Net string, w dns.ResponseWriter, req *dns.Msg) {
} else {
Debug("%s didn't found in hosts file", Q.qname)
}
}
// Only query cache when qtype == 'A' , qclass == 'IN'
// Only query cache when qtype == 'A'|'AAAA' , qclass == 'IN'
key := KeyGen(Q)
if IPQuery > 0 {
mesg, err := h.cache.Get(key)
@ -134,7 +133,6 @@ func (h *GODNSHandler) do(Net string, w dns.ResponseWriter, req *dns.Msg) {
h.mu.Unlock()
return
}
}
mesg, err := h.resolver.Lookup(Net, req)
@ -149,14 +147,11 @@ func (h *GODNSHandler) do(Net string, w dns.ResponseWriter, req *dns.Msg) {
if IPQuery > 0 && len(mesg.Answer) > 0 {
err = h.cache.Set(key, mesg)
if err != nil {
Debug("Set %s cache failed: %s", Q.String(), err.Error())
}
Debug("Insert %s into cache", Q.String())
}
}
func (h *GODNSHandler) DoTCP(w dns.ResponseWriter, req *dns.Msg) {