mirror of
https://github.com/miekg/dns.git
synced 2025-10-12 10:21:00 +02:00
Make Funkensturm somewhat better
This commit is contained in:
parent
7cf37d9d6f
commit
9bee591bc0
@ -55,7 +55,9 @@ func (c Cache) lookup(q *dns.Msg) []byte {
|
||||
if im, ok := c[q.Question[0].Name]; ok {
|
||||
// we have the name
|
||||
if d, ok := im[i]; ok {
|
||||
return d
|
||||
e := make([]byte, len(d))
|
||||
copy(e, d)
|
||||
return e
|
||||
}
|
||||
}
|
||||
return nil
|
||||
@ -73,6 +75,7 @@ func checkcache(m *dns.Msg, ok bool) (o []byte) {
|
||||
o[1] = byte(m.MsgHdr.Id)
|
||||
return
|
||||
}
|
||||
println("Cache miss")
|
||||
var p *dns.Msg
|
||||
// nothing found
|
||||
for _, c := range qr {
|
||||
|
@ -99,6 +99,7 @@ func doFunkensturm(pkt *dns.Msg) ([]byte, os.Error) {
|
||||
// change is cumulative.
|
||||
ok, ok1 := true, true
|
||||
pkt1 := pkt
|
||||
if len(f.Matches) > 0 {
|
||||
for _, m := range f.Matches {
|
||||
pkt1, ok1 = m.Func(pkt1, IN)
|
||||
switch m.Op {
|
||||
@ -108,6 +109,7 @@ func doFunkensturm(pkt *dns.Msg) ([]byte, os.Error) {
|
||||
ok = ok || ok1
|
||||
}
|
||||
}
|
||||
}
|
||||
if *verbose { //modified
|
||||
verboseprint(pkt1, ">> ")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user