mirror of
https://github.com/fatedier/frp.git
synced 2025-07-28 08:27:41 +00:00
fix a race condition issue (#3536)
This commit is contained in:
@@ -143,7 +143,9 @@ func (pxy *BaseProxy) HandleTCPWorkConnection(workConn net.Conn, m *msg.StartWor
|
||||
}
|
||||
}
|
||||
if baseConfig.UseCompression {
|
||||
remote = libio.WithCompression(remote)
|
||||
var releaseFn func()
|
||||
remote, releaseFn = libio.WithCompressionFromPool(remote)
|
||||
defer releaseFn()
|
||||
}
|
||||
|
||||
// check if we need to send proxy protocol info
|
||||
|
@@ -97,7 +97,9 @@ func (pxy *SUDPProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn) {
|
||||
}
|
||||
}
|
||||
if pxy.cfg.UseCompression {
|
||||
rwc = libio.WithCompression(rwc)
|
||||
var releaseFn func()
|
||||
rwc, releaseFn = libio.WithCompressionFromPool(rwc)
|
||||
defer releaseFn()
|
||||
}
|
||||
conn = utilnet.WrapReadWriteCloserToConn(rwc, conn)
|
||||
|
||||
|
@@ -108,7 +108,9 @@ func (pxy *UDPProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn) {
|
||||
}
|
||||
}
|
||||
if pxy.cfg.UseCompression {
|
||||
rwc = libio.WithCompression(rwc)
|
||||
var releaseFn func()
|
||||
rwc, releaseFn = libio.WithCompressionFromPool(rwc)
|
||||
defer releaseFn()
|
||||
}
|
||||
conn = utilnet.WrapReadWriteCloserToConn(rwc, conn)
|
||||
|
||||
|
Reference in New Issue
Block a user