mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-08 10:27:10 -05:00
fix buffer release time
This commit is contained in:
parent
0067d3c80f
commit
334b7bf5ed
@ -107,7 +107,6 @@ func (p *pipe) writeMultiBufferInternal(mb buf.MultiBuffer) error {
|
|||||||
defer p.Unlock()
|
defer p.Unlock()
|
||||||
|
|
||||||
if err := p.getState(false); err != nil {
|
if err := p.getState(false); err != nil {
|
||||||
mb.Release()
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,7 +121,11 @@ func (p *pipe) WriteMultiBuffer(mb buf.MultiBuffer) error {
|
|||||||
|
|
||||||
for {
|
for {
|
||||||
err := p.writeMultiBufferInternal(mb)
|
err := p.writeMultiBufferInternal(mb)
|
||||||
if err == nil || err != errBufferFull {
|
if err == nil {
|
||||||
|
p.readSignal.Signal()
|
||||||
|
return nil
|
||||||
|
} else if err != errBufferFull {
|
||||||
|
mb.Release()
|
||||||
p.readSignal.Signal()
|
p.readSignal.Signal()
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user