Always return UDP buffers to pool (#958)
This commit is contained in:
parent
cfee849963
commit
357af3038a
|
@ -573,13 +573,12 @@ func (srv *Server) serveDNS(m []byte, w *response) {
|
||||||
req.Ns, req.Answer, req.Extra = nil, nil, nil
|
req.Ns, req.Answer, req.Extra = nil, nil, nil
|
||||||
|
|
||||||
w.WriteMsg(req)
|
w.WriteMsg(req)
|
||||||
|
fallthrough
|
||||||
|
case MsgIgnore:
|
||||||
if w.udp != nil && cap(m) == srv.UDPSize {
|
if w.udp != nil && cap(m) == srv.UDPSize {
|
||||||
srv.udpPool.Put(m[:srv.UDPSize])
|
srv.udpPool.Put(m[:srv.UDPSize])
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
|
||||||
case MsgIgnore:
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue