From c7096d7c09d78c9e0af200a30852a8a52a49e8d9 Mon Sep 17 00:00:00 2001 From: maxlerebourg Date: Thu, 3 Sep 2026 10:13:05 +0200 Subject: [PATCH] :bento: Simplify comments on connection draining logic --- bouncer.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bouncer.go b/bouncer.go index 379a4e3..d3837b4 100644 --- a/bouncer.go +++ b/bouncer.go @@ -803,10 +803,8 @@ func appsecQuery(bouncer *Bouncer, ip string, httpReq *http.Request) error { return nil } defer func() { - // net/http only returns a connection to the idle pool once its body has - // been read to EOF; closing early discards it. Drain here rather than at - // the end of the function so the 500 and non-200 paths, which return - // earlier, keep their connections too. + // net/http returns a conn to the idle pool once its body has been read to EOF, closing early discards it. + // Drain the body from the non-200 paths, which return earlier, keep their connections too. if _, errDrain := io.Copy(io.Discard, res.Body); errDrain != nil { bouncer.log.Debug("appsecQuery:drainBody " + errDrain.Error()) }