Skip to content

Commit

Permalink
http: init BodyReader fields
Browse files Browse the repository at this point in the history
  • Loading branch information
lesismal committed Sep 24, 2024
1 parent 5ec7332 commit e9d641b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nbhttp/body.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ func (br *BodyReader) append(data []byte) error {
// NewBodyReader creates a BodyReader.
func NewBodyReader(engine *Engine) *BodyReader {
br := bodyReaderPool.Get().(*BodyReader)
br.left = 0
br.index = 0
br.buffers = nil
br.engine = engine
return br
}

0 comments on commit e9d641b

Please sign in to comment.