From cd52818487fade395c4d9189ce6e70cc03aeecb2 Mon Sep 17 00:00:00 2001 From: Mateusz Poliwczak Date: Sun, 21 Aug 2022 20:33:42 +0000 Subject: [PATCH] net: turn off dns compression for go resolver queries We don't need compression enabled here, because we only set one question in the dns message. So there is nothing to compress. Also it reduces 8 allocs per LookupHost. Change-Id: I0968f837011daf6d7a7b22d9af4a8cc5b2878f4c GitHub-Last-Rev: 7eb3362bcaa86f47c9d975375b54c7177e8dd15e GitHub-Pull-Request: golang/go#54576 Reviewed-on: https://go-review.googlesource.com/c/go/+/425043 Reviewed-by: Damien Neil Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gopher Robot Auto-Submit: Ian Lance Taylor --- src/net/dnsclient_unix.go | 1 - 1 file changed, 1 deletion(-) diff --git a/src/net/dnsclient_unix.go b/src/net/dnsclient_unix.go index cc0bf244ea..bf522e6b28 100644 --- a/src/net/dnsclient_unix.go +++ b/src/net/dnsclient_unix.go @@ -54,7 +54,6 @@ var ( func newRequest(q dnsmessage.Question) (id uint16, udpReq, tcpReq []byte, err error) { id = uint16(randInt()) b := dnsmessage.NewBuilder(make([]byte, 2, 514), dnsmessage.Header{ID: id, RecursionDesired: true}) - b.EnableCompression() if err := b.StartQuestions(); err != nil { return 0, nil, nil, err } -- 2.50.0