Skip to content

Commit

Permalink
refactor: Remove lint suppression and fix buffer pool usage in dualSt…
Browse files Browse the repository at this point in the history
…ream function
  • Loading branch information
arloor committed Oct 11, 2024
1 parent 7c33fdd commit 234bee7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions internal/server/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ func dualStream(target net.Conn, clientReader io.ReadCloser, clientWriter io.Wri
if !ok {
return errors.New("failed to get buffer from pool")
}
// nolint:staticcheck
defer bufferPool.Put(buf)
defer bufferPool.Put(buf) //nolint:staticcheck
buf = buf[0:cap(buf)]
nw, _err := flushingIoCopy(w, r, buf)
ProxyTraffic.WithLabelValues(clientAddr, hostPort, username).Add(float64(nw))
Expand Down

0 comments on commit 234bee7

Please sign in to comment.