Apply same pausedCond logic on all implementation

This commit is contained in:
Zoltán Papp 2025-02-21 14:55:56 +01:00
parent 648b4cdf72
commit d496d21693
2 changed files with 6 additions and 22 deletions

View File

@ -161,17 +161,9 @@ func (p *ProxyBind) proxyToLocal(ctx context.Context) {
return
}
for {
p.pausedCond.L.Lock()
if p.paused {
for p.paused {
p.pausedCond.Wait()
if !p.paused {
break
}
p.pausedCond.L.Unlock()
continue
}
break
}
msg := bind.RecvMessage{

View File

@ -120,17 +120,9 @@ func (p *ProxyWrapper) proxyToLocal(ctx context.Context) {
return
}
for {
p.pausedCond.L.Lock()
if p.paused {
for p.paused {
p.pausedCond.Wait()
if !p.paused {
break
}
p.pausedCond.L.Unlock()
continue
}
break
}
err = p.wgeBPFProxy.sendPkg(buf[:n], p.wgEndpointCurrentUsedAddr)