Always return UDP buffers to pool (#958)

This commit is contained in:
Tom Thorogood 2019-04-30 15:42:45 +09:30 committed by Miek Gieben
parent cfee849963
commit 357af3038a
1 changed files with 2 additions and 3 deletions

View File

@ -573,13 +573,12 @@ func (srv *Server) serveDNS(m []byte, w *response) {
req.Ns, req.Answer, req.Extra = nil, nil, nil
w.WriteMsg(req)
fallthrough
case MsgIgnore:
if w.udp != nil && cap(m) == srv.UDPSize {
srv.udpPool.Put(m[:srv.UDPSize])
}
return
case MsgIgnore:
return
}