Skip to content

Commit

Permalink
Cleanup in putLengthReader
Browse files Browse the repository at this point in the history
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
  • Loading branch information
perhapsmaple and francislavoie authored Oct 2, 2023
1 parent 2c9d8eb commit d74e227
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/caddyhttp/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit d74e227

Please sign in to comment.