diff options
| author | Shulhan <ms@kilabit.info> | 2026-01-27 14:55:37 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2026-02-02 16:28:11 +0700 |
| commit | 6c7b070156c030de11c2a4b46ea6101f7e6142c0 (patch) | |
| tree | c30408af336412ca0f2a65a78a7093fe6205521a /lib/dns/server.go | |
| parent | 93149aeb09a1641be37d6fc62846a244d957b81a (diff) | |
| download | pakakeh.go-6c7b070156c030de11c2a4b46ea6101f7e6142c0.tar.xz | |
lib/dns: minimize use of append
In handleDoHRequest, we did not need to call append, just copy it as is.
In DoTClient and TCPClient, since we already do make, use direct copy
instead of another append.
Diffstat (limited to 'lib/dns/server.go')
| -rw-r--r-- | lib/dns/server.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dns/server.go b/lib/dns/server.go index 32fd8241..2090d383 100644 --- a/lib/dns/server.go +++ b/lib/dns/server.go @@ -476,7 +476,7 @@ func (srv *Server) handleDoHRequest(raw []byte, w http.ResponseWriter) { req.kind = connTypeDoH req.writer = cl - req.message.packet = append(req.message.packet[:0], raw...) + req.message.packet = raw err = req.message.UnpackHeaderQuestion() if err != nil { |
