change []byte bufpool to *[]byte

This commit is contained in:
ginuerzh
2022-01-06 09:50:37 +08:00
parent 3b48c4acfb
commit f45dc93e92
16 changed files with 98 additions and 86 deletions

View File

@ -116,14 +116,14 @@ func (h *dnsHandler) Handle(ctx context.Context, conn net.Conn) {
b := bufpool.Get(4096)
defer bufpool.Put(b)
n, err := conn.Read(b)
n, err := conn.Read(*b)
if err != nil {
h.logger.Error(err)
return
}
h.logger.Info("read data: ", n)
reply, err := h.exchange(ctx, b[:n])
reply, err := h.exchange(ctx, (*b)[:n])
if err != nil {
return
}