From d74e227a09fcefbb3674b0cd286cbcc8093d8bf4 Mon Sep 17 00:00:00 2001 From: Harish Shan <140232061+perhapsmaple@users.noreply.github.com> Date: Mon, 2 Oct 2023 11:18:50 +0530 Subject: [PATCH] Cleanup in putLengthReader Co-authored-by: Francis Lavoie --- modules/caddyhttp/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/caddyhttp/server.go b/modules/caddyhttp/server.go index a64b3524fc4..54e8d2dc828 100644 --- a/modules/caddyhttp/server.go +++ b/modules/caddyhttp/server.go @@ -921,12 +921,12 @@ var lengthReaderPool = sync.Pool{ func getLengthReader(source io.ReadCloser) *lengthReader { reader := lengthReaderPool.Get().(*lengthReader) reader.Source = source - reader.Length = 0 return reader } func putLengthReader(reader *lengthReader) { reader.Source = nil + reader.Length = 0 lengthReaderPool.Put(reader) }