Skip to content

Commit

Permalink
Create buffers of input size instead of *2
Browse files Browse the repository at this point in the history
  • Loading branch information
raghav-stripe committed Feb 15, 2024
1 parent 408139a commit 3603c49
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions internal/transport/http_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,9 @@ func newFramer(conn net.Conn, writeBufferSize, readBufferSize int, sharedWriteBu
return f
}

func getWriteBufferPool(writeBufferSize int) *sync.Pool {
func getWriteBufferPool(size int) *sync.Pool {

Check warning on line 421 in internal/transport/http_util.go

View check run for this annotation

Codecov / codecov/patch

internal/transport/http_util.go#L421

Added line #L421 was not covered by tests
writeBufferMutex.Lock()
defer writeBufferMutex.Unlock()
size := writeBufferSize * 2
pool, ok := writeBufferPoolMap[size]
if ok {
return pool
Expand Down

0 comments on commit 3603c49

Please sign in to comment.