fix incorrect use of snappy pool (#3549)

This commit is contained in:
fatedier
2023-07-25 21:31:26 +08:00
committed by GitHub
parent 6430afcfa5
commit e9e12cf888
11 changed files with 22 additions and 25 deletions

View File

@ -97,9 +97,7 @@ func (pxy *SUDPProxy) InWorkConn(conn net.Conn, _ *msg.StartWorkConn) {
}
}
if pxy.cfg.UseCompression {
var releaseFn func()
rwc, releaseFn = libio.WithCompressionFromPool(rwc)
defer releaseFn()
rwc = libio.WithCompression(rwc)
}
conn = utilnet.WrapReadWriteCloserToConn(rwc, conn)