Skip to content

Commit d40fc04

Browse files
committed
Closes the responseWriter after serving the Answer
Currently we are leaving the response writer open for both connected sockets (TCP) and non-connected sockets (UPD), this change closes the response writer accordingly. Signed-off-by: Nino Kodabande <[email protected]>
1 parent 40a617c commit d40fc04

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pkg/hostagent/dns/dns.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ func (h *Handler) handleQuery(w dns.ResponseWriter, req *dns.Msg) {
150150
reply dns.Msg
151151
handled bool
152152
)
153+
defer w.Close()
153154
reply.SetReply(req)
154155
logrus.Debugf("handleQuery received DNS query: %v", req)
155156
for _, q := range req.Question {

0 commit comments

Comments
 (0)