fix a race condition issue (#3536)

This commit is contained in:
fatedier
2023-07-20 22:32:32 +08:00
committed by GitHub
parent 90861b6821
commit efcc028a3d
12 changed files with 34 additions and 14 deletions

View File

@@ -241,7 +241,9 @@ func (pxy *BaseProxy) handleUserTCPConnection(userConn net.Conn) {
}
}
if cfg.UseCompression {
local = libio.WithCompression(local)
var releaseFn func()
local, releaseFn = libio.WithCompressionFromPool(local)
defer releaseFn()
}
if pxy.GetLimiter() != nil {