mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -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()
|
||||
|
||||
if err := p.getState(false); err != nil {
|
||||
mb.Release()
|
||||
return err
|
||||
}
|
||||
|
||||
@ -122,7 +121,11 @@ func (p *pipe) WriteMultiBuffer(mb buf.MultiBuffer) error {
|
||||
|
||||
for {
|
||||
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()
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user