mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-03 07:56:42 -05:00
fix mb copy again
This commit is contained in:
parent
e0a2247a07
commit
9ee9af9e02
@ -392,21 +392,21 @@ func (c *Connection) WriteMultiBuffer(mb buf.MultiBuffer) error {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
mbPtr := &mb
|
||||||
|
|
||||||
for {
|
for {
|
||||||
for {
|
for {
|
||||||
if c == nil || c.State() != StateActive {
|
if c == nil || c.State() != StateActive {
|
||||||
return io.ErrClosedPipe
|
return io.ErrClosedPipe
|
||||||
}
|
}
|
||||||
|
|
||||||
mbPtr := &mb
|
|
||||||
|
|
||||||
if !c.sendingWorker.Push(func(bb []byte) (int, error) {
|
if !c.sendingWorker.Push(func(bb []byte) (int, error) {
|
||||||
return mbPtr.Read(bb[:c.mss])
|
return mbPtr.Read(bb[:c.mss])
|
||||||
}) {
|
}) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
updatePending = true
|
updatePending = true
|
||||||
if mb.IsEmpty() {
|
if mbPtr.IsEmpty() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user